[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: How do i check null values in a for each???
Hi suman assuming that ur XML looks like ..
<attributes> <attr name = "addrdesc"> <value>value1</value> </attr> <attr name = "AddrDesc"> <value>value2</value> </attr> </attributes> your xsl would be .. <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <xsl:for-each select="/attributes/attr"> <td>  <input type="text"> <xsl:attribute name="name">txtAddressDesc</xsl:attribute> <xsl:attribute name="value"><xsl:value-of select="value[(parent::attr/@name='addrdesc1') or (parent::attr/@name = 'AddrDesc1')]"></xsl:value-of></xsl:attribute> </input> </td> </xsl:for-each> </xsl:template> </xsl:stylesheet> This works FOR THE XML STRUCTURE I HAVE ASSUMED. ---- XSL Gurus .. please advise if there are better ways to do this. --- vasu From: Suman.Sathyanarayan@xxxxxxxxxxxx Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: How do i check null values in a for each??? Date: Tue, 30 Apr 2002 16:32:42 +0530 _________________________________________________________________ Join the world?s largest e-mail service with MSN Hotmail. http://www.hotmail.com 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
|