vinodxx
05-28-2009, 09:28 AM
Hello friends,
I have a newbie question.
How to use xsl:sort and xsl:choose simultaneously on a single stylesheet.
<xsl:for-each select = "CATALOG/CD">
<xsl:sort select = "TITLE" />
<xsl:choose>
<xsl:when test="PRICE > 10">
<tr bgcolor = "#ececec">
<td ><xsl:value-of select="TITLE" /></td>
<td><xsl:value-of select="ARTIST" /></td>
<td><xsl:value-of select="COUNTRY" /></td>
</tr>
</xsl:when>
<xsl:otherwise>
<tr bgcolor = "#ababab">
<td ><xsl:value-of select="TITLE" /></td>
<td><xsl:value-of select="ARTIST" /></td>
<td><xsl:value-of select="COUNTRY" /></td>
</tr>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
The above code will not work in Firefox.
The error returned was
Error loading stylesheet: Parsing an XSLT stylesheet failed.
Please give your advice.
I have a newbie question.
How to use xsl:sort and xsl:choose simultaneously on a single stylesheet.
<xsl:for-each select = "CATALOG/CD">
<xsl:sort select = "TITLE" />
<xsl:choose>
<xsl:when test="PRICE > 10">
<tr bgcolor = "#ececec">
<td ><xsl:value-of select="TITLE" /></td>
<td><xsl:value-of select="ARTIST" /></td>
<td><xsl:value-of select="COUNTRY" /></td>
</tr>
</xsl:when>
<xsl:otherwise>
<tr bgcolor = "#ababab">
<td ><xsl:value-of select="TITLE" /></td>
<td><xsl:value-of select="ARTIST" /></td>
<td><xsl:value-of select="COUNTRY" /></td>
</tr>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
The above code will not work in Firefox.
The error returned was
Error loading stylesheet: Parsing an XSLT stylesheet failed.
Please give your advice.