Subject: [xsl] Conditional Setting of a locale From: Mark Anderson <mark.anderson@xxxxxxxxxxxxxxxxxxx> Date: Thu, 15 May 2008 18:00:33 +0100 |
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
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] <xsl:copy-of select="." /, John Ericson | Thread | Re: [xsl] Conditional Setting of a , Martin Honnen |
Re: [xsl] fo:block affects layout o, Tony Graham | Date | Re: [xsl] Conditional Setting of a , Martin Honnen |
Month |