Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries [Thread Prev] >Thread Next - Re: xsl:if problems xsl:if problemsTo: NULL Date: 5/3/2007 9:58:00 AM Ok, this seems like it should be easy, but it has escaped me. Here is my xml file: <ref_sheet> <item> <date>2007/04/06</date> <product>124567</product> <description>TAB DIVIDERS</description> <note>Description of problem here</note> <expired>true</expired> </item> <item> <date>2007/04/25</date> <product></product> <description>Diploma/Certificate Folders</description> <note>description of problem here. </note> <expired>false</expired> </item> </ref_sheet> Here is the stylesheet: <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/ Transform"> <xsl:output method="html"/> <xsl:template match="/"> <html> <body> <input type="button" value="Close this window" onclick="self.close()"/ > <xsl:apply-templates/> </body> </html> </xsl:template> <xsl:template match="ref_sheet"> <table border="1"> <tr> <th align="center">Date</th><!--Column 1--> <th align="center">Product ID</th><!--Column 2--> <th align="center">Product Description</th><!--Column3--> <th align="center">Notes</th><!--Column4--> <th align="center">expired</th><!--Column5--> </tr> <xsl:apply-templates/> </table> </xsl:template> <xsl:template match="item"> <xsl:if test="expired = false"> <tr> <td><xsl:copy-of select="date"/></td> <td><xsl:copy-of select="product"/></td> <td><xsl:copy-of select="description"/></td> <td><xsl:copy-of select="note"/></td> <td><xsl:copy-of select="expired"/></td> </tr> </xsl:if> </xsl:template> </xsl:stylesheet> This is being transformed client-side using MSXML in IE 6.x. It won't correctly process the if statement. What I want it to do is only display the items which are not expired (for which expired = false). What it does is give me the table header row, but it does not return any of the non-expired items. | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
