I'm trying to display different information depending on incoming data. If it's an integer, I want to display just the number, if it's a decimal, I want to use 0.00# pattern. Ya, I know, a bit mixed up, but that's the development spec. :>
I have the following XSL for this specific section but I can't see to get past the xsl:when error message of
"Expected end of expression, found 'castable'. number(SAVG) -->castable <-- as xs:decimal"
<xsl:choose>
<xsl:when test="number(SAVG) > 0">
<xsl:choose>
<xsl:when test="number(SAVG) castable as xs:decimal">
<xsl:value-of select="format-number(SAVG, '###,###,##0.00#')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="format-number(SAVG, '###,###,##0.###')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="number(SAVG) = 0">
<xsl:text disable-output-escaping="yes">&lt;</xsl:text>1
</xsl:when>
<xsl:otherwise>N/A</xsl:otherwise>
</xsl:choose>
I tried looking/poking around for answers and I have tried "instance of", I've tried using xsl:if, etc but I can't seem to get this to work. Any help would be greatly appreciated.
Thanks.
From comments:
Yes, we are using 1.0. I'm sorry I'm new to the XSL processing, how do I glue your XSL and input to generate the html?