Changeset 7897
- Timestamp:
- 04/01/07 20:54:36 (22 months ago)
- Location:
- util/trunk/buildscripts/cldr
- Files:
-
- 4 modified
-
build.xml (modified) (6 diffs)
-
calendar.xsl (modified) (1 diff)
-
currency.xsl (modified) (1 diff)
-
number.xsl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
util/trunk/buildscripts/cldr/build.xml
r7860 r7897 9 9 10 10 <!-- project properties --> 11 <!-- FIXME: use location instead of value where appropriate? -->12 11 <property name="project" value="dojo"/> 13 <property name="root" value="../../.."/> 14 <property name="lang" value="en"/> 12 <property name="root" location="../../.."/> 15 13 <property name="dojoLoader" value="default"/> 16 <property name="currencies" value="GBP,USD,CAD,AUD,EUR,CHF,HKD,JPY"/> <!-- FIXME: arbitrary list. Can be altered or eliminated forall currencies -->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 --> 17 15 <property name="ldml" location="ldml"/> 18 16 <property name="json" location="${root}/dojo/cldr/nls"/> … … 45 43 <include name="js.jar"/> 46 44 <include name="ant-apache-bsf.jar"/> 45 <include name="saxon8.jar"/> 46 <include name="resolver.jar"/> 47 47 </fileset> 48 48 </copy> … … 90 90 return true; 91 91 } 92 92 93 93 var delTask = project.createTask("delete"); 94 94 function deleteResource(f){ … … 113 113 load.setProperty(uniqueId); 114 114 load.perform(); 115 115 116 116 var contents = String(project.getProperty(uniqueId)); 117 117 if(contents.charCodeAt(0) == 0xfeff){ contents = contents.substring(1); } // JDK bug workaround … … 138 138 <macrodef name="processLdml"> 139 139 <attribute name="in"/> 140 <attribute name="basedir"/> 140 141 <attribute name="destdir"/> 141 142 142 143 <sequential> 143 144 <mkdir dir="@{destdir}"/> 144 < saxon in="@{in}" style="calendar.xsl" destdir="@{destdir}"/>145 < saxon in="@{in}" style="number.xsl" destdir="@{destdir}"/>146 < saxon in="@{in}" style="currency.xsl" destdir="@{destdir}"/>145 <transform in="@{in}" style="calendar.xsl" basedir="@{basedir}" destdir="@{destdir}"/> 146 <transform in="@{in}" style="number.xsl" basedir="@{basedir}" destdir="@{destdir}"/> 147 <transform in="@{in}" style="currency.xsl" basedir="@{basedir}" destdir="@{destdir}"/> 147 148 <echo level="info" message="Transformed @{in} to @{destDir}" taskName="cldr"/> 148 149 <removeEmptyOutput dir="@{destdir}" /> 149 150 </sequential> 150 151 </macrodef> 151 <macrodef name="saxon"> 152 <!-- XSLT ant tasks run for a while, then hang. Perhaps there's a file handle leak? 153 Kludge: Run as separate JVM processes instead to be safe. --> 152 <macrodef name="transform"> 154 153 <attribute name="in"/> 155 154 <attribute name="style"/> 155 <attribute name="basedir"/> 156 156 <attribute name="destdir"/> 157 157 158 158 <sequential> 159 <java fork="true" dir="@{destdir}" jar="lib/saxon8.jar"> 160 <!-- Reference the DTD locally to speed things up --> 161 <!-- resolver and CatalogManager.properties have to be on the bootclasspath, apparently 162 in order for JAXP to find them --> 163 <jvmarg value="-Xbootclasspath/a:${ldml}/../lib/resolver.jar"/> 164 <jvmarg value="-Xbootclasspath/a:${ldml}"/> 165 <arg value="-r"/> 166 <arg value="org.apache.xml.resolver.tools.CatalogResolver"/> 167 <arg value="-x"/> 168 <arg value="org.apache.xml.resolver.tools.ResolvingXMLReader"/> 169 <arg value="-y"/> 170 <arg value="org.apache.xml.resolver.tools.ResolvingXMLReader"/> 171 <arg file="@{in}"/> 172 <arg file="@{style}"/> 173 <arg value="currencyList=${currencies}"/> 174 </java> 159 <xslt includes="@{in}" style="@{style}" destdir="@{destdir}" basedir="@{basedir}" extension=".tmp"> 160 <factory name="net.sf.saxon.TransformerFactoryImpl" /> 161 <xmlcatalog> 162 <catalogpath path="ldml/catalog" /> 163 </xmlcatalog> 164 <param name="currencyList" expression="${currencies}" /> 165 </xslt> 166 <delete> 167 <fileset dir="@{destdir}" includes="*.tmp" /> 168 </delete> 175 169 </sequential> 176 170 </macrodef> … … 192 186 193 187 var ldml = project.createTask("processLdml"); 194 ldml.setDynamicAttribute("in", new java.io.File( basedir+"/"+filename));188 ldml.setDynamicAttribute("in", new java.io.File(filename)); 195 189 ldml.setDynamicAttribute("destdir", outDir); 190 ldml.setDynamicAttribute("basedir", basedir); 196 191 ldml.perform(); 197 192 } 198 193 ]]> 199 194 </scriptdef> 200 201 <!-- kludge to fix the "Fail to load **.xml" exception which occurs in IBM JDK 1.4.2202 where saxon uses wrong base with relative URIs. AP: Sun Java 1.5 also? -->203 <copy todir="${ldml}/core/main">204 <fileset dir=".">205 <include name="**/*.xsl"/>206 </fileset>207 </copy>208 195 209 196 <delete dir="${json}" /> -
util/trunk/buildscripts/cldr/calendar.xsl
r7858 r7897 494 494 <!-- source is an external xml file --> 495 495 <xsl:if test="string-length($xpath)>0"> 496 <xsl:for-each select="doc(concat( $source,'.xml'))">496 <xsl:for-each select="doc(concat('ldml/core/main/',concat($source,'.xml')))"> 497 497 <xsl:for-each select="saxon:evaluate($xpath)"> 498 498 <xsl:call-template name="invoke_template_by_name"> -
util/trunk/buildscripts/cldr/currency.xsl
r7858 r7897 125 125 <!-- source is an external xml file --> 126 126 <xsl:if test="string-length($xpath)>0"> 127 <xsl:for-each select="doc(concat($source,'.xml'))">127 <xsl:for-each select="doc(concat('ldml/core/main/',concat($source,'.xml')))"> 128 128 <xsl:for-each select="saxon:evaluate($xpath)"> 129 129 <xsl:call-template name="invoke_template_by_name"> -
util/trunk/buildscripts/cldr/number.xsl
r7858 r7897 202 202 <!-- source is an external xml file --> 203 203 <xsl:if test="string-length($xpath)>0"> 204 <xsl:for-each select="doc(concat( $source,'.xml'))">204 <xsl:for-each select="doc(concat('ldml/core/main/',concat($source,'.xml')))"> 205 205 <xsl:for-each select="saxon:evaluate($xpath)"> 206 206 <xsl:call-template name="invoke_template_by_name">