From: Hugo van der Merwe <17109322+hugovdm@users.noreply.github.com> Date: Tue, 25 Feb 2020 21:49:48 +0000 (+0100) Subject: ICU-20568 Fix sorting of unitPreferenceData rules: units.xml X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=16d3cdb0fefdcde625d3832955d848a23ea738eb;p=icu ICU-20568 Fix sorting of unitPreferenceData rules: units.xml --- diff --git a/tools/cldr/cldr-to-icu/src/main/resources/ldml2icu_supplemental.txt b/tools/cldr/cldr-to-icu/src/main/resources/ldml2icu_supplemental.txt index 607b65acdf5..bfe8485adca 100644 --- a/tools/cldr/cldr-to-icu/src/main/resources/ldml2icu_supplemental.txt +++ b/tools/cldr/cldr-to-icu/src/main/resources/ldml2icu_supplemental.txt @@ -98,20 +98,6 @@ //supplementalData/measurementData/paperSize[@type="A4"][@territories="(%W)"] ; /measurementData/$1/PaperSize:intvector ; values=297 210 //supplementalData/measurementData/paperSize[@type="US-Letter"][@territories="(%W)"] ; /measurementData/$1/PaperSize:intvector ; values=279 216 -# Quoting "$1" and "$2" in the output lets $3 expand space-separated regions: only the first unquoted output supports such expansion. -//supplementalData/unitPreferenceData/unitPreferences[@category="(%W)"][@usage="(%A)"]/unitPreference[@regions="(%A)"] - ; /unitPreferenceData/"$1"/"$2"/$3//unit -//supplementalData/unitPreferenceData/unitPreferences[@category="(%W)"][@usage="(%A)"]/unitPreference[@regions="(%A)"][@geq="(%A)"] - ; /unitPreferenceData/"$1"/"$2"/$3//unit - ; /unitPreferenceData/"$1"/"$2"/$3//geq ; values=$4 -//supplementalData/unitPreferenceData/unitPreferences[@category="(%W)"][@usage="(%A)"]/unitPreference[@regions="(%A)"][@skeleton="(%A)"] - ; /unitPreferenceData/"$1"/"$2"/$3//unit - ; /unitPreferenceData/"$1"/"$2"/$3//skeleton ; values=$4 -//supplementalData/unitPreferenceData/unitPreferences[@category="(%W)"][@usage="(%A)"]/unitPreference[@regions="(%A)"][@geq="(%A)"][@skeleton="(%A)"] - ; /unitPreferenceData/"$1"/"$2"/$3//unit - ; /unitPreferenceData/"$1"/"$2"/$3//geq ; values=$4 - ; /unitPreferenceData/"$1"/"$2"/$3//skeleton ; values=$5 - //supplementalData/territoryInfo/territory[@type="(%W)"][@gdp="(%N)"][@literacyPercent="(%N)"][@population="(%N)"]/languagePopulation[@type="(%W)"][@writingPercent="(%N)"][@populationPercent="(%N)"][@officialStatus="(%W)"](?:[@references="%W"])? ; /territoryInfo/$1/territoryF:intvector ; values=&exp($2) &exp($3,-2) &exp($4) ; base_xpath=//supplementalData/territoryInfo/territory[@type="$1"] ; /territoryInfo/$1/$5/writingShareF:int ; values=&exp($6,-2) @@ -191,6 +177,23 @@ ; /convertUnits/$1/factor ; values="$3" ; /convertUnits/$1/reciprocal ; values=$4 +# Quoting "$1" and "$2" in the output lets $3 expand space-separated regions: only the first unquoted output supports such expansion. +//supplementalData/unitPreferenceData/unitPreferences[@category="(%W)"][@usage="(%A)"]/unitPreference[@regions="(%A)"] + ; /unitPreferenceData/"$1"/"$2"/$3//unit + +//supplementalData/unitPreferenceData/unitPreferences[@category="(%W)"][@usage="(%A)"]/unitPreference[@regions="(%A)"][@geq="(%A)"] + ; /unitPreferenceData/"$1"/"$2"/$3//unit + ; /unitPreferenceData/"$1"/"$2"/$3//geq ; values=$4 + +//supplementalData/unitPreferenceData/unitPreferences[@category="(%W)"][@usage="(%A)"]/unitPreference[@regions="(%A)"][@skeleton="(%A)"] + ; /unitPreferenceData/"$1"/"$2"/$3//unit + ; /unitPreferenceData/"$1"/"$2"/$3//skeleton ; values=$4 + +//supplementalData/unitPreferenceData/unitPreferences[@category="(%W)"][@usage="(%A)"]/unitPreference[@regions="(%A)"][@geq="(%A)"][@skeleton="(%A)"] + ; /unitPreferenceData/"$1"/"$2"/$3//unit + ; /unitPreferenceData/"$1"/"$2"/$3//geq ; values=$4 + ; /unitPreferenceData/"$1"/"$2"/$3//skeleton ; values=$5 + # languageInfo.xml //supplementalData/languageMatching/languageMatches[@type="(%B)_new"]/paradigmLocales[@locales="(%A)"] ; /languageMatchingInfo/$1/paradigmLocales ; values=$2