I've been attempting to use an xsl:sort within an xsl:for-each with no luck. Can anyone help me solve this?
I'm using the following xsl that gets called when selecting a Sort button in an HTML page (the xml is a data island)
<charges>
<xsl:for-each select="transaction" xmlns:xsl=" <xsl:sort select="amt" order="ascending" data-type="number"/>
<transaction>
<xsl:attribute name="type"><xsl:value-of select="@type"/>
</xsl:attribute>
<date><xsl:value-of select="date"/></date>
<vendor><xsl:value-of select="vendor"/></vendor>
<amt><xsl:value-of select="amt"/></amt>
</transaction>
</xsl:for-each>
</charges>
The xsl:sort statement cause me to get no output at all. If I remove it - the data is sorted by amount - but in an ascii order - not by value. Here is a small example of the data:
<?xml version="1.0"?>
<charges>
<transaction type="credit">
<date>05/26/01</date>
<vendor>EDDY'S BIKE SHOP</vendor>
<amt>211.49</amt>
</transaction>
<transaction type="credit">
<date>05/27/01</date>
<vendor>HOME DEPOT</vendor>
<amt>74.11</amt>
</transaction>
<transaction type="debit">
<date>05/27/01</date>
<vendor>HOME DEPOT</vendor>
<amt>4.52</amt>
</transaction>
</charges>
Any ideas?
Thanks
Tim Ryan
I'm using the following xsl that gets called when selecting a Sort button in an HTML page (the xml is a data island)
<charges>
<xsl:for-each select="transaction" xmlns:xsl=" <xsl:sort select="amt" order="ascending" data-type="number"/>
<transaction>
<xsl:attribute name="type"><xsl:value-of select="@type"/>
</xsl:attribute>
<date><xsl:value-of select="date"/></date>
<vendor><xsl:value-of select="vendor"/></vendor>
<amt><xsl:value-of select="amt"/></amt>
</transaction>
</xsl:for-each>
</charges>
The xsl:sort statement cause me to get no output at all. If I remove it - the data is sorted by amount - but in an ascii order - not by value. Here is a small example of the data:
<?xml version="1.0"?>
<charges>
<transaction type="credit">
<date>05/26/01</date>
<vendor>EDDY'S BIKE SHOP</vendor>
<amt>211.49</amt>
</transaction>
<transaction type="credit">
<date>05/27/01</date>
<vendor>HOME DEPOT</vendor>
<amt>74.11</amt>
</transaction>
<transaction type="debit">
<date>05/27/01</date>
<vendor>HOME DEPOT</vendor>
<amt>4.52</amt>
</transaction>
</charges>
Any ideas?
Thanks
Tim Ryan