[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Conditional Setting of a locale
Hi All I'm stuck with decimal formatting in my XSL stylesheet (XSLT 1.0 only). My users are based in UK (so locale is en-GB), but they need to output documents with figures in Euro's, US$ and GBP. The latter two are no problem, but I can't figure out a way to change the decimal format for documents being sent to Europe. I have an XML element called <currency> that tells me the target currency. Conceptually, I want to do this: <xsl:choose> <xsl:when test="currency = 'Euro'"> <xsl:decimal-format name="standard" decimal-separator="," grouping-separator="."/> <xsl:variable name="number" select="#.,00"/> </xsl:when> <xsl:otherwise> <xsl:decimal-format name="standard" decimal-separator="." grouping-separator=","/> <xsl:variable name="number" select="#,.00"/> </xsl:otherwise> </xsl:choose> Unfortunately, it's not possible as xsl:decimal-format needs to be at the top level and xsl:choose, etc. must be in the template body. So, is there a way to set the decimal format based on the content of the XML with all docs being generated in an single locale? I'd like to extend this to date formatting too if possible. TIA Mark
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|