RE: Empty tags

Subject: RE: Empty tags
From: Ben Robb <Ben@xxxxxxxxxx>
Date: Thu, 19 Aug 1999 16:31:05 +0100
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>


Ben Robb

-----Original Message-----
From: Minita Jha [mailto:jha@xxxxxxxxxxx]
Sent: 19 August 1999 16:04
To: xsl-list@xxxxxxxxxxxxxxxx
Subject: Empty tags


  How does one handle empty tags? For eg, consider the following xml:
     <street_1>xxxx Drive</street_1>
   <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> 

In this case the header for street_2 is printed out. This is what I want to 



 XSL-List info and archive:

 XSL-List info and archive:

Current Thread
  • Empty tags
    • Minita Jha - Thu, 19 Aug 1999 11:04:03 -0400 (EDT)
      • <Possible follow-ups>
      • Ben Robb - Thu, 19 Aug 1999 16:31:05 +0100 <=