This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: XML/XSL output
- From: "Américo Albuquerque" <aalbuquerque at viseu dot ipiaget dot pt>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Wed, 11 Sep 2002 10:50:19 +0100
- Subject: RE: [xsl] XML/XSL output
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hi.
You could use
<xsl:when test="Account | Company">
.....
</xsl:when>
-----Original Message-----
From: owner-xsl-list@lists.mulberrytech.com
[mailto:owner-xsl-list@lists.mulberrytech.com] On Behalf Of
Girish.Savadatti
Sent: Tuesday, September 10, 2002 7:10 PM
To: 'xsl-list@lists.mulberrytech.com'
Subject: [xsl] XML/XSL output
Hi,
I have xml element as follows :
- <metadata>
<URL>www.yahoo.com</URL>
<DocTitle>June, July and August 2002 EDI Updates</DocTitle>
<DocType>ImportantUpdates</DocType>
<SecurityGroup>Public</SecurityGroup>
<ReleaseDate>8/28/2002 11:29 AM</ReleaseDate>
<Site>Extranet, Intranet</Site>
</metadata>
- <metadata>
<URL>www.hotmail.com</URL>
<DocTitle>June, July and August 2002 EDI Updates</DocTitle>
<DocType>ImportantUpdates</DocType>
<SecurityGroup>Public</SecurityGroup>
<ReleaseDate>8/28/2002 11:28 AM</ReleaseDate>
<Company>Sun</Company>
<Site>Extranet, Intranet</Site>
</metadata>
There are two main elements I am looking for 1) Account 2) Company.
Account element may or may not exists.
Company element may or may not exists.
I am trying to write xsl style sheet to get html output depending upon
above conditions.
<xsl:when test="Account[.=''] and Company[.='']">
<tr>
<td>
<a>
<xsl:attribute name="href"><xsl:value-of
select="URL"/></xsl:attribute>
<xsl:value-of select="DocTitle"/>
</a>
</td>
<td><xsl:value-of select="substring-before(ReleaseDate, '
')"/></td>
</tr>
<tr><td><br></br></td></tr>
</xsl:when>
if both Account and Company elements are missing then
url(www.yahoo.com)
should be displayed on the html output. The xsl code is not working and
doesn't display any link on page.
Does xsl has any function that will check for element existence? OR
How can we check for null object in xsl? The above condition is
checking
for blank value.
Anybody has idea about this problem?
Thanks in advance.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list