Show
Ignore:
Timestamp:
04/02/07 06:50:55 (22 months ago)
Author:
peller
Message:

Refactor xslt utilities, generate localization json at dojo._cldr. Refs #2624

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • util/trunk/buildscripts/cldr/currency.xsl

    r7897 r7906  
    11<?xml version="1.0" encoding="UTF-8"?> 
    22<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"/> 
    34<xsl:output method="text" indent="yes"/> 
    45<!-- list the data elements whose spaces should be preserved 
     
    1112        otherwise all the currencies will be extracted by default--> 
    1213<xsl:param name="currencyList"></xsl:param> 
    13 <xsl:variable name="first" select="true()" saxon:assignable="yes"/> 
    1414 
    1515<xsl:template match="/"> 
     
    105105        </xsl:choose> 
    106106    </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 
    139108    <!-- too bad that can only use standard xsl:call-template(name can not be variable)  
    140109         error occurs if use <saxson:call-templates($templateToCall)  /> --> 
    141110    <xsl:template name="invoke_template_by_name"> 
    142111        <xsl:param name="templateName"></xsl:param> 
     112        <xsl:param name="name"></xsl:param>  
     113        <xsl:param name="width"></xsl:param> 
    143114        <xsl:if test="$templateName='top'"> 
    144115            <xsl:call-template name="top"></xsl:call-template> 
     
    148119        </xsl:if> 
    149120    </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      
    162121</xsl:stylesheet>