Jump to content

alexandreteles

Members
  • Posts

    2
  • Joined

  • Last visited

alexandreteles's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Hi,I´m having a problem to sort the output in currency format. I have a currency in the xml file, that has the format (#.###,00). The result of the transformation is not correct because the XSLT recognize the tag <amount> as string. I tried the element data-type=”number”, but the XSLT results NaN (not a number), because of the comma(,). Does anyone can help me?My XML is: <import><via><name>Air</name> <amount>183.852,40</amount>< name >Sea</ name > <amount>283.852,50</amount>< name >Terrestrial</ name > <amount>5.885,90</amount></via></import> My xsl file is: <?xml version="1.0"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="import"> <xsl:apply-templates select="via"> <xsl:sort select="amount"/> </xsl:apply-templates> </xsl:template> <xsl:template match="via"> <tr> <td> <xsl:value-of select="name" /> </td> <td> <xsl:value-of select="amount" /> </td> </tr> </xsl:template></xsl:stylesheet>
×
×
  • Create New...