|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Empty tags
Your XML is not well formed - though this is probably just a typo...line 3
should read "<street_2></street_2>" or "<street_2/>"
As for the XSL, you could use:
<xsl:if test="street_2[.!='']">
<P>Street 2 :
<xsl:value-of select="street_2"/></P>
</xsl:if>
Rgs,
Ben Robb
-----Original Message-----
From: Minita Jha [mailto:jha@xxxxxxxxxxx]
Sent: 19 August 1999 16:04
To: xsl-list@xxxxxxxxxxxxxxxx
Subject: Empty tags
Hi,
How does one handle empty tags? For eg, consider the following xml:
<address>
<street_1>xxxx Drive</street_1>
<street_2><street_2>
<city>Bethesda</city>
<state>MD</state>
</address>
Xsl:
<xsl:template match="address">
<P>Street 1:
<xsl:value-of select="street_1"/></P>
<P>Street 2 :
<xsl:value-of select="street_2"/></P>
<P>City :
<xsl:value-of select="city"/></P>
<P>State :
<xsl:value-of select="state"/></P>
</xsl:template>
In this case the header for street_2 is printed out. This is what I want to
avoid.
Thanks
Minita.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








