RE: [xsl] How do i check null values in a for each???

Subject: RE: [xsl] How do i check null values in a for each???
From: TSchutzerWeissmann@xxxxxxxxxxxxxxxx
Date: Tue, 30 Apr 2002 13:02:28 +0100
Suman wrote

><xsl:for-each select="attr[@name='addrdesc1' or @name='AddrDesc1']">
>    <td>&#160; <input type="text">
>     <xsl:attribute name="name">txtAddressDesc</xsl:attribute>
>     <xsl:attribute name="value"><xsl:value-of select
>="value"></xsl:value-of></xsl:attribute>
>     </input>
>         </td>
></xsl:for-each>
>
>
>
>Now consider for instance the above for-each does'nt return a value at all.
>I.e there is'nt an attribute called addrdesc1 in the xml schema response
>So obviously it does't enter the for-each and does NOT display the text
>box.
>
>but i still want to display an empty text box to the user
>in the XSL , How do i do this???

Hello Suman,

you could just follow the block above with a block like this:

<xsl:if test = "not(attr[@name='addrdesc1' or @name='AddrDesc1'])">
	<input type="text" name="emptybox" value=""/>
</xsl:if>

Regards,
Tom Schutzer-Weissmann

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread