Changeset 7906 for util/trunk/buildscripts/cldr/number.xsl
- Timestamp:
- 04/02/07 06:50:55 (22 months ago)
- Files:
-
- 1 modified
-
util/trunk/buildscripts/cldr/number.xsl (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
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>