Changeset 7906
- Timestamp:
- 04/02/07 06:50:55 (20 months ago)
- Location:
- util/trunk/buildscripts/cldr
- Files:
-
- 1 added
- 4 modified
-
build.xml (modified) (3 diffs)
-
calendar.xsl (modified) (4 diffs)
-
currency.xsl (modified) (4 diffs)
-
number.xsl (modified) (4 diffs)
-
util.xsl (added)
Legend:
- Unmodified
- Added
- Removed
-
util/trunk/buildscripts/cldr/build.xml
r7897 r7906 14 14 <property name="currencies" value="GBP,USD,CAD,AUD,EUR,CHF,HKD,JPY"/> <!-- FIXME: arbitrary list. Property can be altered or eliminated to build all currencies --> 15 15 <property name="ldml" location="ldml"/> 16 <property name="json" location="${root}/dojo/ cldr/nls"/>16 <property name="json" location="${root}/dojo/_cldr/nls"/> 17 17 18 18 <!-- -check-config task --> … … 155 155 <attribute name="basedir"/> 156 156 <attribute name="destdir"/> 157 158 157 <sequential> 159 158 <xslt includes="@{in}" style="@{style}" destdir="@{destdir}" basedir="@{basedir}" extension=".tmp"> … … 162 161 <catalogpath path="ldml/catalog" /> 163 162 </xmlcatalog> 163 <param name="basedir" expression="@{basedir}/" /> 164 164 <param name="currencyList" expression="${currencies}" /> 165 165 </xslt> -
util/trunk/buildscripts/cldr/calendar.xsl
r7897 r7906 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 2 <xsl:stylesheet xmlns:saxon="http://saxon.sf.net/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" extension-element-prefixes="saxon" version="2.0"> 3 <xsl:import href="util.xsl"/> 3 4 <xsl:output method="text" indent="yes"/> 4 5 <!-- list the data elements whose spaces should be preserved … … 7 8 <xsl:strip-space elements="*"/> 8 9 9 <xsl:variable name="first" select="true()" saxon:assignable="yes"/>10 11 10 <xsl:template match="/"> 12 11 <xsl:apply-templates/> … … 453 452 </xsl:template> 454 453 455 <!-- Sub output routine-->456 <xsl:variable name="vLowercaseChars_CONST" select="'abcdefghijklmnopqrstuvwxyz'"/>457 <xsl:variable name="vUppercaseChars_CONST" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>458 <xsl:template name="camel_case">459 <xsl:param name="name"></xsl:param>460 <xsl:variable name="words" select="tokenize($name, '-')"></xsl:variable>461 <xsl:for-each select="$words">462 <xsl:choose>463 <xsl:when test="position()=1">464 <xsl:value-of select="."/>465 </xsl:when>466 <xsl:otherwise>467 <xsl:value-of select="translate(substring(., 1, 1), $vLowercaseChars_CONST, $vUppercaseChars_CONST)"/><xsl:value-of select="substring(., 2)"/>468 </xsl:otherwise>469 </xsl:choose>470 </xsl:for-each>471 </xsl:template>472 473 <!-- recursive process for alias -->474 <xsl:template name="alias_template">475 <xsl:param name="templateToCall"></xsl:param>476 <xsl:param name="source"></xsl:param>477 <xsl:param name="xpath"></xsl:param>478 479 <xsl:variable name="cur_name" select="../name()"></xsl:variable>480 <xsl:variable name="cur_width" select="../@type"></xsl:variable>481 482 <xsl:choose>483 <!-- source="locale" -->484 <xsl:when test="$source='locale'">485 <xsl:for-each select="saxon:evaluate(concat('../',$xpath))">486 <xsl:call-template name="invoke_template_by_name">487 <xsl:with-param name="templateName" select="$templateToCall"></xsl:with-param>488 <xsl:with-param name="name" select="$cur_name"></xsl:with-param>489 <xsl:with-param name="width" select="$cur_width"></xsl:with-param>490 </xsl:call-template>491 </xsl:for-each>492 </xsl:when>493 <xsl:otherwise>494 <!-- source is an external xml file -->495 <xsl:if test="string-length($xpath)>0">496 <xsl:for-each select="doc(concat('ldml/core/main/',concat($source,'.xml')))">497 <xsl:for-each select="saxon:evaluate($xpath)">498 <xsl:call-template name="invoke_template_by_name">499 <xsl:with-param name="templateName" select="$templateToCall"></xsl:with-param>500 <xsl:with-param name="name" select="$cur_name"></xsl:with-param>501 <xsl:with-param name="width" select="$cur_width"></xsl:with-param>502 </xsl:call-template>503 </xsl:for-each>504 </xsl:for-each>505 </xsl:if>506 </xsl:otherwise>507 </xsl:choose>508 </xsl:template>509 510 454 <!-- too bad that can only use standard xsl:call-template(name can not be variable) 511 455 error occurs if use <saxson:call-templates($templateToCall) /> --> … … 549 493 </xsl:if> 550 494 </xsl:template> 551 552 <xsl:template name="insert_comma">553 <xsl:choose>554 <xsl:when test="$first">555 <saxon:assign name="first" select="false()"/>556 </xsl:when>557 <xsl:otherwise>558 <xsl:text>,</xsl:text>559 </xsl:otherwise>560 </xsl:choose>561 </xsl:template>562 563 495 </xsl:stylesheet> -
util/trunk/buildscripts/cldr/currency.xsl
r7897 r7906 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 2 <xsl:stylesheet xmlns:saxon="http://saxon.sf.net/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" extension-element-prefixes="saxon" version="2.0"> 3 <xsl:import href="util.xsl"/> 3 4 <xsl:output method="text" indent="yes"/> 4 5 <!-- list the data elements whose spaces should be preserved … … 11 12 otherwise all the currencies will be extracted by default--> 12 13 <xsl:param name="currencyList"></xsl:param> 13 <xsl:variable name="first" select="true()" saxon:assignable="yes"/>14 14 15 15 <xsl:template match="/"> … … 105 105 </xsl:choose> 106 106 </xsl:template> 107 108 <!-- recursive process for alias --> 109 <xsl:template name="alias_template"> 110 <xsl:param name="templateToCall"></xsl:param> 111 <xsl:param name="source"></xsl:param> 112 <xsl:param name="xpath"></xsl:param> 113 <xsl:variable name="cur_width" select="../@type"></xsl:variable> 114 115 <xsl:choose> 116 <xsl:when test="compare($source,'locale')=0"> 117 <!-- source="locale" --> 118 <xsl:for-each select="saxon:evaluate(concat('../',$xpath))"> 119 <xsl:call-template name="invoke_template_by_name"> 120 <xsl:with-param name="templateName" select="$templateToCall"></xsl:with-param> 121 </xsl:call-template> 122 </xsl:for-each> 123 </xsl:when> 124 <xsl:otherwise> 125 <!-- source is an external xml file --> 126 <xsl:if test="string-length($xpath)>0"> 127 <xsl:for-each select="doc(concat('ldml/core/main/',concat($source,'.xml')))"> 128 <xsl:for-each select="saxon:evaluate($xpath)"> 129 <xsl:call-template name="invoke_template_by_name"> 130 <xsl:with-param name="templateName" select="$templateToCall"></xsl:with-param> 131 </xsl:call-template> 132 </xsl:for-each> 133 </xsl:for-each> 134 </xsl:if> 135 </xsl:otherwise> 136 </xsl:choose> 137 </xsl:template> 138 107 139 108 <!-- too bad that can only use standard xsl:call-template(name can not be variable) 140 109 error occurs if use <saxson:call-templates($templateToCall) /> --> 141 110 <xsl:template name="invoke_template_by_name"> 142 111 <xsl:param name="templateName"></xsl:param> 112 <xsl:param name="name"></xsl:param> 113 <xsl:param name="width"></xsl:param> 143 114 <xsl:if test="$templateName='top'"> 144 115 <xsl:call-template name="top"></xsl:call-template> … … 148 119 </xsl:if> 149 120 </xsl:template> 150 151 <xsl:template name="insert_comma">152 <xsl:choose>153 <xsl:when test="$first">154 <saxon:assign name="first" select="false()"/>155 </xsl:when>156 <xsl:otherwise>157 <xsl:text>,</xsl:text>158 </xsl:otherwise>159 </xsl:choose>160 </xsl:template>161 162 121 </xsl:stylesheet> -
util/trunk/buildscripts/cldr/number.xsl
r7897 r7906 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 2 <xsl:stylesheet xmlns:saxon="http://saxon.sf.net/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" extension-element-prefixes="saxon" version="2.0"> 3 <xsl:import href="util.xsl"/> 3 4 <xsl:output method="text" indent="yes"/> 4 5 <!-- list the data elements whose spaces should be preserved … … 6 7 <xsl:preserve-space elements="decimal group list pattern currencyMatch surroundingMatch insertBetween"/> 7 8 <xsl:strip-space elements="*"/> 8 9 <xsl:variable name="first" select="true()" saxon:assignable="yes"/>10 9 11 10 <xsl:template match="/"> … … 178 177 </xsl:choose> 179 178 </xsl:template> 180 179 181 180 <xsl:template name="currencies" match="currencies"></xsl:template> 182 181 183 <!-- recursive process for alias -->184 <xsl:template name="alias_template">185 <xsl:param name="templateToCall"></xsl:param>186 <xsl:param name="source"></xsl:param>187 <xsl:param name="xpath"></xsl:param>188 189 <xsl:variable name="cur_width" select="../@type"></xsl:variable>190 191 <xsl:choose>192 <!-- source="locale" -->193 <xsl:when test="$source='locale'">194 <xsl:for-each select="saxon:evaluate(concat('../',$xpath))">195 <xsl:call-template name="invoke_template_by_name">196 <xsl:with-param name="templateName" select="$templateToCall"></xsl:with-param>197 <xsl:with-param name="width" select="$cur_width"></xsl:with-param>198 </xsl:call-template>199 </xsl:for-each>200 </xsl:when>201 <xsl:otherwise>202 <!-- source is an external xml file -->203 <xsl:if test="string-length($xpath)>0">204 <xsl:for-each select="doc(concat('ldml/core/main/',concat($source,'.xml')))">205 <xsl:for-each select="saxon:evaluate($xpath)">206 <xsl:call-template name="invoke_template_by_name">207 <xsl:with-param name="templateName" select="$templateToCall"></xsl:with-param>208 <xsl:with-param name="width" select="$cur_width"></xsl:with-param>209 </xsl:call-template>210 </xsl:for-each>211 </xsl:for-each>212 </xsl:if>213 </xsl:otherwise>214 </xsl:choose>215 </xsl:template>216 217 182 <!-- too bad that can only use standard xsl:call-template(name can not be variable) 218 183 error occurs if use <saxson:call-templates($templateToCall) /> --> 219 184 <xsl:template name="invoke_template_by_name"> 220 <xsl:param name="templateName"></xsl:param> 185 <xsl:param name="templateName"></xsl:param> 186 <xsl:param name="name"></xsl:param> 221 187 <xsl:param name="width"></xsl:param> 222 188 <xsl:if test="$templateName='top'"> … … 238 204 </xsl:if> 239 205 </xsl:template> 240 241 <xsl:template name="insert_comma">242 <xsl:choose>243 <xsl:when test="$first">244 <saxon:assign name="first" select="false()"/>245 </xsl:when>246 <xsl:otherwise>247 <xsl:text>,</xsl:text>248 </xsl:otherwise>249 </xsl:choose>250 </xsl:template>251 206 </xsl:stylesheet>