Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


xsl:if problems

From: Doulos05 <doulos05@-----.--->
To: 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.



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent