| 4 | | <xsl:strip-space elements="*"/> |
| 5 | | |
| | 4 | <!-- list the data elements whose spaces should be preserved |
| | 5 | it seems listing only the parent node doesn't work --> |
| | 6 | <xsl:preserve-space elements="displayName symbol"/> |
| | 7 | <xsl:strip-space elements="*"/> |
| | 8 | |
| | 9 | <!-- currencyList is an external string property like "AUD|BEF|CAD|CHF|CNY|DEM|...|USD", |
| | 10 | if it is provided, only those currencies in this list will be extracted, |
| | 11 | otherwise all the currencies will be extracted by default--> |
| | 12 | <xsl:param name="currencyList"></xsl:param> |
| | 13 | <xsl:variable name="first" select="true()" saxon:assignable="yes"/> |
| | 14 | |
| 26 | | <!-- currencies --> |
| 27 | | <xsl:for-each select="currency"> |
| 28 | | <xsl:value-of select="@type"></xsl:value-of> |
| 29 | | <xsl:result-document href="{concat(@type,'.js')}" encoding="UTF-8">// generated from cldr/ldml/main/*.xml, xpath: ldml/numbers/currencies |
| 30 | | ({<xsl:call-template name="currency"></xsl:call-template> |
| | 35 | <xsl:result-document href="currency.js" encoding="UTF-8">// generated from cldr/ldml/main/*.xml, xpath: ldml/numbers/currencies |
| | 36 | ({<xsl:choose><xsl:when test="string-length(string($currencyList))>0"> |
| | 37 | <xsl:for-each select="currency"> |
| | 38 | <xsl:if test="contains($currencyList,@type)"> |
| | 39 | <xsl:call-template name="currency"></xsl:call-template> |
| | 40 | </xsl:if> |
| | 41 | </xsl:for-each> |
| | 42 | </xsl:when> |
| | 43 | <xsl:otherwise> |
| | 44 | <xsl:for-each select="currency"> |
| | 45 | <xsl:call-template name="currency"></xsl:call-template> |
| | 46 | </xsl:for-each> |
| | 47 | </xsl:otherwise> |
| | 48 | </xsl:choose> |
| 69 | | <xsl:for-each select="*[not(@draft)] | *[@draft!='provisional' and @draft!='unconfirmed']"> |
| 70 | | '<xsl:value-of select="name()"></xsl:value-of> |
| 71 | | <xsl:text>': "</xsl:text> |
| 72 | | <xsl:value-of select="replace(.,'"', '\\"')"></xsl:value-of> |
| 73 | | <xsl:text>"</xsl:text> |
| 74 | | <xsl:if test="count((following-sibling::node())[not(@draft)] |
| 75 | | | *[@draft!='provisional' and @draft!='unconfirmed']) > 0 "> |
| 76 | | <xsl:text>,</xsl:text> |
| 77 | | </xsl:if> |
| 78 | | </xsl:for-each> |
| | 86 | <xsl:if test="count(./* [(not(@draft) or @draft!='provisional' and @draft!='unconfirmed')]) > 0"> |
| | 87 | <xsl:call-template name="insert_comma"/> |
| | 88 | <xsl:text> |
| | 89 | </xsl:text> |
| | 90 | <xsl:value-of select="@type"></xsl:value-of> |
| | 91 | <xsl:text>:{</xsl:text> |
| | 92 | <xsl:for-each select="*[not(@draft)] | *[@draft!='provisional' and @draft!='unconfirmed']"> |
| | 93 | <xsl:value-of select="name()"></xsl:value-of> |
| | 94 | <xsl:text>:"</xsl:text> |
| | 95 | <xsl:value-of select="replace(.,'"', '\\"')"></xsl:value-of> |
| | 96 | <xsl:text>"</xsl:text> |
| | 97 | <xsl:if test="count((following-sibling::node())[not(@draft)] |
| | 98 | | *[@draft!='provisional' and @draft!='unconfirmed']) > 0 "> |
| | 99 | <xsl:text>, </xsl:text> |
| | 100 | </xsl:if> |
| | 101 | </xsl:for-each> |
| | 102 | <xsl:text>}</xsl:text> |
| | 103 | </xsl:if> |