http://www.w3schools.com/xsl/default.asp
In my project i used it to transform xml document to csv file.
TransformBillingXmlToCsv.xml
xsl:template name="amount"
xsl:text " /xsl:text
xsl:value-of select="currencySymbol"/
xsl:text /xsl:text
xsl:choose
xsl:when test="currencySymbol = 'JPY'"
xsl:value-of select='format-number(value, "#.")'/
/xsl:when
xsl:otherwise
xsl:value-of select='format-number(value, "#.00")'/
/xsl:otherwise
/xsl:choose
xsl:text " /xsl:text
/xsl:template
(tag characters are removed from above sample code)
Here i had to use XSLT format-number() Function and XSLT
http://www.w3schools.com/XSL/func_formatnumber.asp
http://www.w3schools.com/xsl/el_when.asp
No comments:
Post a Comment