• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# ldml2icu_locale.txt
2#
3# © 2016 and later: Unicode, Inc. and others.
4#
5# CLDR data files are interpreted according to the LDML specification (http://unicode.org/reports/tr35/)
6# For terms of use, see http://www.unicode.org/copyright.html
7#
8# Used by LdmlLocaleMapper.
9# Data-driven file for mapping LDML locale paths to ICU paths.
10# See ldml2icu_readme.txt for a detailed explanation of this file.
11
12# Variables
13# Attribute value
14%A=[^"']++
15# Word
16%W=[\w\-]++
17# Greedy word match
18%G=[\w\-]+
19# Number match
20%N=\d++
21# The default numbering system to be used.
22%D=//ldml/numbers/defaultNumberingSystem
23
24# Main locale data
25
26# Aliases
27
28//ldml/dates/calendars/calendar[@type="(%A)"]/alias[@source="locale"][@path="../calendar[@type='(%A)']"]
29     ; /calendar/$1lo ; values=/LOCALE/calendar/$2
30
31//ldml/dates/calendars/calendar[@type="(%A)"]/dayPeriods/alias[@source="locale"][@path="../../calendar[@type='(%A)']/dayPeriods"]
32     ; /calendar/$1/AmPmMarkers:alias ; values=/LOCALE/calendar/$2/AmPmMarkers
33     ; /calendar/$1/AmPmMarkersNarrow:alias ; values=/LOCALE/calendar/$2/AmPmMarkersNarrow
34     ; /calendar/$1/NoonMarker:alias ; values=/LOCALE/calendar/$2/NoonMarker
35     ; /calendar/$1/NoonMarkerNarrow:alias ; values=/LOCALE/calendar/$2/NoonMarkerNarrow
36
37//ldml/dates/calendars/calendar[@type="gregorian"]/dayPeriods/dayPeriodContext[@type="format"]/dayPeriodWidth[@type="wide"]/alias[@source="locale"][@path="../dayPeriodWidth[@type='abbreviated']"]
38     ; /calendar/gregorian/AmPmMarkers:alias ; values=/LOCALE/calendar/gregorian/AmPmMarkersAbbr
39//ldml/dates/calendars/calendar[@type="gregorian"]/dayPeriods/dayPeriodContext[@type="format"]/dayPeriodWidth[@type="narrow"]/alias[@source="locale"][@path="../dayPeriodWidth[@type='abbreviated']"]
40     ; /calendar/gregorian/AmPmMarkersNarrow:alias ; values=/LOCALE/calendar/gregorian/AmPmMarkersAbbr
41
42//ldml/dates/calendars/calendar[@type="(%A)"]/(eras|quarters|cyclicNameSets|monthPatterns)/alias[@source="locale"][@path="../../%W[@type='(%A)']/%W"]
43     ; /calendar/$1/$2:alias ; values=/LOCALE/calendar/$3/$2
44
45//ldml/dates/calendars/calendar[@type="(%A)"]/eras/eraNarrow/alias[@source="locale"][@path="../eraAbbr"]
46     ; /calendar/$1/eras/narrow:alias ; values=/LOCALE/calendar/$1/eras/abbreviated
47//ldml/dates/calendars/calendar[@type="(%A)"]/eras/eraNames/alias[@source="locale"][@path="../eraAbbr"]
48     ; /calendar/$1/eras/wide:alias ; values=/LOCALE/calendar/$1/eras/abbreviated
49
50//ldml/dates/calendars/calendar[@type="(%A)"]/(cyclicNameSet)s/\2[@type="(%W)"]/alias[@source="locale"][@path="../\2[@type='(%A)']"]
51     ; /calendar/$1/$2s/$3:alias ; values=/LOCALE/calendar/$1/$2s/$4
52//ldml/dates/calendars/calendar[@type="(%A)"]/(cyclicNameSet)s/\2[@type="(%W)"]/(cyclicName)Context[@type="(%W)"]/\4Width[@type="(%W)"]/alias[@source="locale"][@path="../../../\4Set[@type='(%A)']/\4Context[@type='(%A)']/\4Width[@type='(%A)']"]
53     ; /calendar/$1/$2s/$3/$5/$6:alias ; values=/LOCALE/calendar/$1/$2s/$7/$8/$9
54//ldml/dates/calendars/calendar[@type="(%A)"]/(cyclicNameSet)s/\2[@type="(%W)"]/(cyclicName)Context[@type="(%W)"]/\4Width[@type="(%W)"]/alias[@source="locale"][@path="../\4Width[@type='(%A)']"]
55     ; /calendar/$1/$2s/$3/$5/$6:alias ; values=/LOCALE/calendar/$1/$2s/$3/$5/$7
56//ldml/dates/calendars/calendar[@type="(%A)"]/(cyclicNameSet|monthPattern|quarter)s/\2Context[@type="(%W)"]/\2Width[@type="(%W)"]/alias[@source="locale"][@path="../../\2Context[@type='(%W)']/\2Width[@type='(%A)']"]
57     ; /calendar/$1/$2s/$3/$4:alias    ; values=/LOCALE/calendar/$1/$2s/$5/$6
58
59//ldml/dates/calendars/calendar[@type="(%A)"]/(day|month)s/alias[@source="locale"][@path="../../%W[@type='(%A)']/%W"]
60     ; /calendar/$1/$2Names:alias ; values=/LOCALE/calendar/$3/$2Names
61
62//ldml/dates/calendars/calendar[@type="(%A)"]/(day|month)s/\2Context[@type="(%W)"]/\2Width[@type="(%W)"]/alias[@source="locale"][@path="../\2Width[@type='(%A)']"]
63     ; /calendar/$1/$2Names/$3/$4:alias ; values=/LOCALE/calendar/$1/$2Names/$3/$5
64//ldml/dates/calendars/calendar[@type="(%A)"]/(day|month)s/\2Context[@type="(%W)"]/\2Width[@type="(%W)"]/alias[@source="locale"][@path="../../\2Context[@type='(%W)']/\2Width[@type='(%A)']"]
65     ; /calendar/$1/$2Names/$3/$4:alias ; values=/LOCALE/calendar/$1/$2Names/$5/$6
66
67//ldml/dates/calendars/calendar[@type="(%A)"]/(monthPattern|quarter)s/\2Context[@type="(%W)"]/\2Width[@type="(%W)"]/alias[@source="locale"][@path="../\2Width[@type='(%A)']"]
68     ; /calendar/$1/$2s/$3/$4:alias ; values=/LOCALE/calendar/$1/$2s/$3/$5
69
70//ldml/dates/calendars/calendar[@type="(%A)"]/dateFormats/alias[@source="locale"][@path="../../calendar[@type='(%A)']/dateFormats"]
71     ; /calendar/$1/DateTimePatterns:alias ; values=/LOCALE/calendar/$2/DateTimePatterns
72//ldml/dates/calendars/calendar[@type="(%A)"]/dateTimeFormats/alias[@source="locale"][@path="../../calendar[@type='(%A)']/dateTimeFormats"]
73     ; /calendar/$1/availableFormats:alias ; values=/LOCALE/calendar/$2/availableFormats
74     ; /calendar/$1/appendItems:alias      ; values=/LOCALE/calendar/$2/appendItems
75     ; /calendar/$1/intervalFormats:alias  ; values=/LOCALE/calendar/$2/intervalFormats
76//ldml/dates/calendars/calendar[@type="(%A)"]/dateTimeFormats/(availableFormats|appendItems|intervalFormats)/alias[@source="locale"][@path="../../../calendar[@type='(%A)']/dateTimeFormats/\2"]
77     ; /calendar/$1/$2:alias ; values=/LOCALE/calendar/$3/$2
78
79//ldml/units/unitLength[@type="long"]/alias[@source="locale"][@path="../unitLength[@type='short']"]
80     ; /units:alias ; values=/LOCALE/unitsShort
81//ldml/units/unitLength[@type="narrow"]/alias[@source="locale"][@path="../unitLength[@type='short']"]
82     ; /unitsNarrow:alias ; values=/LOCALE/unitsShort
83
84//ldml/listPatterns/listPattern[@type="(%A)"]/alias[@source="locale"][@path="../listPattern"]
85     ; /listPattern/$1/start:alias  ; values=/LOCALE/listPattern/standard/start
86     ; /listPattern/$1/middle:alias ; values=/LOCALE/listPattern/standard/middle
87     ; /listPattern/$1/end:alias    ; values=/LOCALE/listPattern/standard/end
88     ; /listPattern/$1/2:alias      ; values=/LOCALE/listPattern/standard/2
89//ldml/listPatterns/listPattern[@type="(%A)"]/alias[@source="locale"][@path="../listPattern[@type='(%A)']"]
90     ; /listPattern/$1/start:alias  ; values=/LOCALE/listPattern/$2/start
91     ; /listPattern/$1/middle:alias ; values=/LOCALE/listPattern/$2/middle
92     ; /listPattern/$1/end:alias    ; values=/LOCALE/listPattern/$2/end
93     ; /listPattern/$1/2:alias      ; values=/LOCALE/listPattern/$2/2
94
95//ldml/numbers/currencyFormats[@numberSystem="(%A)"]/currencyFormatLength/currencyFormat[@type="accounting"]/alias[@source="locale"][@path="../(%W)[@type='standard']"] ; /NumberElements/$1/patterns/accountingFormat:alias ; values=/LOCALE/NumberElements/$1/patterns/$2
96
97//ldml/numbers/(miscPatterns|symbols)[@numberSystem="(%A)"]/alias[@source="locale"][@path="../%W[@numberSystem='(%A)']"]
98     ; /NumberElements/$2/$1:alias ; values=/LOCALE/NumberElements/$3/$1
99//ldml/numbers/(percentFormat|scientificFormat)s[@numberSystem="(%A)"]/alias[@source="locale"][@path="../%W[@numberSystem='(%A)']"]
100     ; /NumberElements/$2/patterns/$1:alias ; values=/LOCALE/NumberElements/$3/patterns/$1
101//ldml/numbers/(currencyFormat|decimalFormat)s[@numberSystem="(%A)"]/alias[@source="locale"][@path="../%W[@numberSystem='(%A)']"]
102     ; /NumberElements/$2/patterns/$1:alias ; values=/LOCALE/NumberElements/$3/patterns/$1
103     ; /NumberElements/$2/patternsShort/$1:alias ; values=/LOCALE/NumberElements/$3/patternsShort/$1
104
105# Characters
106
107//ldml/characters/exemplarCharacters[@type="auxiliary"]      ; /AuxExemplarCharacters
108//ldml/characters/exemplarCharacters[@type="currencySymbol"] ; /ExemplarCharactersCurrency
109//ldml/characters/exemplarCharacters[@type="index"]          ; /ExemplarCharactersIndex
110//ldml/characters/exemplarCharacters[@type="punctuation"]    ; /ExemplarCharactersPunctuation
111//ldml/characters/exemplarCharacters[@type="numbers"]        ; /ExemplarCharactersNumbers
112//ldml/characters/exemplarCharacters                         ; /ExemplarCharacters
113
114//ldml/characters/ellipsis[@type="(%A)"]                     ; /Ellipsis/$1
115//ldml/characters/moreInformation                            ; /MoreInformation
116//ldml/characters/special/icu:scripts/icu:script[@type="%N"] ; /LocaleScript
117
118//ldml/characters/parseLenients[@scope="(%A)"][@level="(%A)"]/parseLenient[@sample="%A"] ; /parse/$1/$2
119
120# Defaults
121
122//ldml/dates/calendars/calendar[@type="(%A)"]/(monthPattern)s/\2Context[@type="(%W)"]/\2Width[@type="(%W)"]/\2[@type="(%W)"]
123     ; /calendar/$1/$2s/$3/$4/$5
124
125# Dates
126
127//ldml/dates/calendars/calendar[@type="(%A)"]/cyclicNameSets/cyclicNameSet[@type="(%A)"]/cyclicNameContext[@type="(%A)"]/cyclicNameWidth[@type="(%A)"]/cyclicName[@type="(%A)"]
128     ; /calendar/$1/cyclicNameSets/$2/$3/$4 ;
129
130# ---- /calendar/xxx/DateTimePatterns
131# Rules are split to force manual ordering within the array produced by them (they share the same output path).
132#
133# Note that (like many other places) the uncaptured "type" attributes are just expected to be "standard", and the %A
134# variable is only used to save a bit of space. The final output array has 3 groups ("time" -> "date" -> "date-time")
135# each with 4 elements in based on the pattern length ("full" -> "long" -> "medium" -> "short") giving 12 patterns in
136# total.
137#
138# However due to an awful hack, there end up being 13 values in the array, with the medium date-time value being
139# duplicated at index 8. However this hack is done later, because the regex transformer does not permit the same
140# CLDR path to emit values in different places in an array.
141
142# Time patterns (4 x values)
143//ldml/dates/calendars/calendar[@type="(%A)"]/(timeFormat)s/\2Length[@type="(%A)"]/\2[@type="%A"]/pattern[@type="%A"]
144     ; /calendar/$1/DateTimePatterns
145
146# Date patterns (4 x values)
147#
148# This is a weird edge case. When the number attribute is present in the xpath, its value needs to be grouped
149# together with the xpath value in its own special array, which is treated like just another value in
150# /DateTimePatterns. The group keyword is used here to specify that values from the same xpath should be grouped
151# into their own separate array. Since each possible pattern length can have patterns with and without the number
152# attribute, we must explicitly split the rules to enforce correct output order.
153#
154# So far (Jan 2014), this only happens in the Chinese calendar for ja/zh/zh_Hant and the Hebrew calendar for he,
155# and all calendars for haw (which has numbers="M=romanlow").
156//ldml/dates/calendars/calendar[@type="(%A)"]/(dateFormat)s/\2Length[@type="(full)"]/\2[@type="%A"]/pattern[@type="%A"]
157     ; /calendar/$1/DateTimePatterns
158//ldml/dates/calendars/calendar[@type="(%A)"]/(dateFormat)s/\2Length[@type="(full)"]/\2[@type="%A"]/pattern[@type="%A"][@numbers="(%A)"]
159     ; /calendar/$1/DateTimePatterns ;  values="{value}" $4 ; group
160//ldml/dates/calendars/calendar[@type="(%A)"]/(dateFormat)s/\2Length[@type="(long)"]/\2[@type="%A"]/pattern[@type="%A"]
161     ; /calendar/$1/DateTimePatterns
162//ldml/dates/calendars/calendar[@type="(%A)"]/(dateFormat)s/\2Length[@type="(long)"]/\2[@type="%A"]/pattern[@type="%A"][@numbers="(%A)"]
163     ; /calendar/$1/DateTimePatterns ;  values="{value}" $4 ; group
164//ldml/dates/calendars/calendar[@type="(%A)"]/(dateFormat)s/\2Length[@type="(medium)"]/\2[@type="%A"]/pattern[@type="%A"]
165     ; /calendar/$1/DateTimePatterns
166//ldml/dates/calendars/calendar[@type="(%A)"]/(dateFormat)s/\2Length[@type="(medium)"]/\2[@type="%A"]/pattern[@type="%A"][@numbers="(%A)"]
167     ; /calendar/$1/DateTimePatterns ;  values="{value}" $4 ; group
168//ldml/dates/calendars/calendar[@type="(%A)"]/(dateFormat)s/\2Length[@type="(short)"]/\2[@type="%A"]/pattern[@type="%A"]
169     ; /calendar/$1/DateTimePatterns
170//ldml/dates/calendars/calendar[@type="(%A)"]/(dateFormat)s/\2Length[@type="(short)"]/\2[@type="%A"]/pattern[@type="%A"][@numbers="(%A)"]
171     ; /calendar/$1/DateTimePatterns ;  values="{value}" $4 ; group
172
173# DateTime patterns (4 x values)
174//ldml/dates/calendars/calendar[@type="(%A)"]/(dateTimeFormat)s/\2Length[@type="(%A)"]/\2[@type="standard"]/pattern[@type="%A"]
175     ; /calendar/$1/DateTimePatterns
176
177# DateTime atTime patterns (4 x values)
178//ldml/dates/calendars/calendar[@type="(%A)"]/(dateTimeFormat)s/\2Length[@type="(%A)"]/\2[@type="atTime"]/pattern[@type="%A"]
179     ; /calendar/$1/DateTimePatterns%atTime
180
181# ---- /calendar/xxx/DateTimeSkeletons
182# This is similar to DateTimePatterns above except that for this we do not have the DateTime patterns (4 x values, plus the duplicate value at index 8).
183
184# Time patterns (4 x values)
185//ldml/dates/calendars/calendar[@type="(%A)"]/(timeFormat)s/\2Length[@type="(%A)"]/\2[@type="%A"]/datetimeSkeleton
186     ; /calendar/$1/DateTimeSkeletons
187
188# Date patterns (4 x values)
189//ldml/dates/calendars/calendar[@type="(%A)"]/(dateFormat)s/\2Length[@type="(full)"]/\2[@type="%A"]/datetimeSkeleton
190     ; /calendar/$1/DateTimeSkeletons
191//ldml/dates/calendars/calendar[@type="(%A)"]/(dateFormat)s/\2Length[@type="(full)"]/\2[@type="%A"]/datetimeSkeleton[@numbers="(%A)"]
192     ; /calendar/$1/DateTimeSkeletons ;  values="{value}" $4 ; group
193//ldml/dates/calendars/calendar[@type="(%A)"]/(dateFormat)s/\2Length[@type="(long)"]/\2[@type="%A"]/datetimeSkeleton
194     ; /calendar/$1/DateTimeSkeletons
195//ldml/dates/calendars/calendar[@type="(%A)"]/(dateFormat)s/\2Length[@type="(long)"]/\2[@type="%A"]/datetimeSkeleton[@numbers="(%A)"]
196     ; /calendar/$1/DateTimeSkeletons ;  values="{value}" $4 ; group
197//ldml/dates/calendars/calendar[@type="(%A)"]/(dateFormat)s/\2Length[@type="(medium)"]/\2[@type="%A"]/datetimeSkeleton
198     ; /calendar/$1/DateTimeSkeletons
199//ldml/dates/calendars/calendar[@type="(%A)"]/(dateFormat)s/\2Length[@type="(medium)"]/\2[@type="%A"]/datetimeSkeleton[@numbers="(%A)"]
200     ; /calendar/$1/DateTimeSkeletons ;  values="{value}" $4 ; group
201//ldml/dates/calendars/calendar[@type="(%A)"]/(dateFormat)s/\2Length[@type="(short)"]/\2[@type="%A"]/datetimeSkeleton
202     ; /calendar/$1/DateTimeSkeletons
203//ldml/dates/calendars/calendar[@type="(%A)"]/(dateFormat)s/\2Length[@type="(short)"]/\2[@type="%A"]/datetimeSkeleton[@numbers="(%A)"]
204     ; /calendar/$1/DateTimeSkeletons ;  values="{value}" $4 ; group
205
206# ----
207
208//ldml/dates/calendars/calendar[@type="(%A)"]/dateTimeFormats/appendItems/appendItem[@request="(%A)"] ; /calendar/$1/appendItems/$2
209
210//ldml/dates/calendars/calendar[@type="(%A)"]/dateTimeFormats/availableFormats/dateFormatItem[@id="(%A)"]                ; /calendar/$1/availableFormats/$2
211//ldml/dates/calendars/calendar[@type="(%A)"]/dateTimeFormats/availableFormats/dateFormatItem[@id="(%A)"][@count="(%A)"] ; /calendar/$1/availableFormats/$2/$3
212
213//ldml/dates/calendars/calendar[@type="(%A)"]/dateTimeFormats/intervalFormats/intervalFormatItem[@id="(%A)"]/greatestDifference[@id="(%A)"] ; /calendar/$1/intervalFormats/$2/$3
214//ldml/dates/calendars/calendar[@type="(%A)"]/dateTimeFormats/intervalFormats/intervalFormatFallback                                        ; /calendar/$1/intervalFormats/fallback
215
216//ldml/dates/calendars/calendar[@type="(%A)"]/dayPeriods/dayPeriodContext[@type="format"]/dayPeriodWidth[@type="wide"]/dayPeriod[@type="(am|pm)"][@alt="(%A)"]        ; /calendar/$1/AmPmMarkers%$3
217//ldml/dates/calendars/calendar[@type="(%A)"]/dayPeriods/dayPeriodContext[@type="format"]/dayPeriodWidth[@type="narrow"]/dayPeriod[@type="(am|pm)"][@alt="(%A)"]      ; /calendar/$1/AmPmMarkersNarrow%$3
218//ldml/dates/calendars/calendar[@type="(%A)"]/dayPeriods/dayPeriodContext[@type="format"]/dayPeriodWidth[@type="abbreviated"]/dayPeriod[@type="(am|pm)"][@alt="(%A)"] ; /calendar/$1/AmPmMarkersAbbr%$3
219
220//ldml/dates/calendars/calendar[@type="(%A)"]/dayPeriods/dayPeriodContext[@type="format"]/dayPeriodWidth[@type="wide"]/dayPeriod[@type="(am|pm)"]        ; /calendar/$1/AmPmMarkers
221//ldml/dates/calendars/calendar[@type="(%A)"]/dayPeriods/dayPeriodContext[@type="format"]/dayPeriodWidth[@type="abbreviated"]/dayPeriod[@type="(am|pm)"] ; /calendar/$1/AmPmMarkersAbbr
222//ldml/dates/calendars/calendar[@type="(%A)"]/dayPeriods/dayPeriodContext[@type="format"]/dayPeriodWidth[@type="narrow"]/dayPeriod[@type="(am|pm)"]      ; /calendar/$1/AmPmMarkersNarrow
223
224//ldml/dates/calendars/calendar[@type="(%A)"]/dayPeriods/dayPeriodContext[@type="(stand-alone)"]/dayPeriodWidth[@type="(%A)"]/dayPeriod[@type="(am|pm)"][@alt="(%A)"] ; /calendar/$1/dayPeriod/$2/$3/$4%$5
225//ldml/dates/calendars/calendar[@type="(%A)"]/dayPeriods/dayPeriodContext[@type="(stand-alone)"]/dayPeriodWidth[@type="(%A)"]/dayPeriod[@type="(am|pm)"]              ; /calendar/$1/dayPeriod/$2/$3/$4
226//ldml/dates/calendars/calendar[@type="(%A)"]/dayPeriods/dayPeriodContext[@type="(%A)"]/dayPeriodWidth[@type="(%A)"]/dayPeriod[@type="(?!am|pm)(%A)"][@alt="(%A)"]    ; /calendar/$1/dayPeriod/$2/$3/$4%$5
227//ldml/dates/calendars/calendar[@type="(%A)"]/dayPeriods/dayPeriodContext[@type="(%A)"]/dayPeriodWidth[@type="(%A)"]/dayPeriod[@type="(?!am|pm)(%A)"]                 ; /calendar/$1/dayPeriod/$2/$3/$4
228
229//ldml/dates/calendars/calendar[@type="(%A)"]/eras/eraNarrow/era[@type="(%A)"][@alt="(%A)"] ; /calendar/$1/eras/narrow%$3
230//ldml/dates/calendars/calendar[@type="(%A)"]/eras/eraAbbr/era[@type="(%A)"][@alt="(%A)"]   ; /calendar/$1/eras/abbreviated%$3
231//ldml/dates/calendars/calendar[@type="(%A)"]/eras/eraNames/era[@type="(%A)"][@alt="(%A)"]  ; /calendar/$1/eras/wide%$3
232
233//ldml/dates/calendars/calendar[@type="(%A)"]/eras/eraNarrow/era[@type="(%A)"] ; /calendar/$1/eras/narrow
234//ldml/dates/calendars/calendar[@type="(%A)"]/eras/eraAbbr/era[@type="(%A)"]   ; /calendar/$1/eras/abbreviated
235//ldml/dates/calendars/calendar[@type="(%A)"]/eras/eraNames/era[@type="(%A)"]  ; /calendar/$1/eras/wide
236
237# Leap year names go after other month names.
238# "yeartype" is an #IMPLIED attribute in the DTD and it should implicitly default to "standard".
239# In practice "standard" is never explicitly given, but it could be (so it must be matched here).
240//ldml/dates/calendars/calendar[@type="(%A)"]/(day|month)s/%W[@type="(%A)"]/%W[@type="(%A)"]/%W[@type="(%A)"](?:[@yeartype="standard"])? ; /calendar/$1/$2Names/$3/$4
241//ldml/dates/calendars/calendar[@type="(%A)"]/(day|month)s/%W[@type="(%A)"]/%W[@type="(%A)"]/%W[@type="(%A)"][@yeartype="leap"] ; /calendar/$1/$2Names/$3/$4
242
243//ldml/dates/calendars/calendar[@type="(%A)"]/(quarters)/%W[@type="(%A)"]/%W[@type="(%A)"]/%W[@type="%A"] ; /calendar/$1/$2/$3/$4
244
245//ldml/dates/fields/field[@type="(%A)"]/displayName[@alt="(%A)"] ; /fields/$1/dn%$2
246//ldml/dates/fields/field[@type="(%A)"]/displayName ; /fields/$1/dn
247//ldml/dates/fields/field[@type="(%A)"]/relative[@type="(%A)"] ; /fields/$1/relative/"$2"
248//ldml/dates/fields/field[@type="(%A)"]/relativePeriod ; /fields/$1/relativePeriod
249//ldml/dates/fields/field[@type="(%A)"]/relativeTime[@type="(%A)"]/relativeTimePattern[@count="(%A)"] ; /fields/$1/relativeTime/$2/$3
250
251//ldml/dates/fields/field[@type="(%A)"]/alias[@source="locale"][@path="../field[@type='(%A)']"] ; /fields/$1:alias ; values=/LOCALE/fields/$2
252
253//ldml/dates/timeZoneNames/regionFormat[@type="daylight"]   ; /zoneStrings/regionFormatDaylight
254//ldml/dates/timeZoneNames/regionFormat[@type="standard"]   ; /zoneStrings/regionFormatStandard
255//ldml/dates/timeZoneNames/(%GFormat)   ; /zoneStrings/$1
256
257//ldml/dates/timeZoneNames/metazone[@type="(%A)"]/(\w)%W/(\w)%W ; /zoneStrings/"meta:$1"/$2$3
258
259//ldml/dates/timeZoneNames/zone[@type="(%W)/(%W)"]/exemplarCity[@alt="(%A)"] ; /zoneStrings/"$1:$2"/ec%$3
260//ldml/dates/timeZoneNames/zone[@type="(%W)/(%W)"]/exemplarCity ; /zoneStrings/"$1:$2"/ec
261//ldml/dates/timeZoneNames/zone[@type="(%W)/(%W)"]/(\w)%W/(\w)%W ; /zoneStrings/"$1:$2"/$3$4
262//ldml/dates/timeZoneNames/zone[@type="(%W)/(%W)/(%W)"]/exemplarCity[@alt="(%A)"] ; /zoneStrings/"$1:$2:$3"/ec%$4
263//ldml/dates/timeZoneNames/zone[@type="(%W)/(%W)/(%W)"]/exemplarCity ; /zoneStrings/"$1:$2:$3"/ec
264
265# Locale Display Names
266
267//ldml/localeDisplayNames/codePatterns/codePattern[@type="(%A)"] ; /codePatterns/$1
268
269//ldml/localeDisplayNames/keys/key[@type="(%A)"] ; /Keys/$1
270
271//ldml/localeDisplayNames/languages/language[@type="(%A)"][@alt="(%A)"] ; /Languages%$2/$1
272//ldml/localeDisplayNames/languages/language[@type="(%A)"] ; /Languages/$1
273
274//ldml/localeDisplayNames/localeDisplayPattern/localeKeyTypePattern ; /localeDisplayPattern/keyTypePattern
275//ldml/localeDisplayNames/localeDisplayPattern/localePattern ; /localeDisplayPattern/pattern
276//ldml/localeDisplayNames/localeDisplayPattern/localeSeparator ; /localeDisplayPattern/separator
277
278//ldml/localeDisplayNames/measurementSystemNames/measurementSystemName[@type="(%A)"] ; /measurementSystemNames/$1
279
280//ldml/localeDisplayNames/scripts/script[@type="(%A)"][@alt="(%A)"] ; /Scripts%$2/$1
281//ldml/localeDisplayNames/scripts/script[@type="(%A)"] ; /Scripts/$1
282
283//ldml/localeDisplayNames/territories/territory[@type="(%A)"][@alt="(%A)"] ; /Countries%$2/$1
284//ldml/localeDisplayNames/territories/territory[@type="(%A)"] ; /Countries/$1
285
286//ldml/localeDisplayNames/transformNames/transformName[@type="(%W)"] ; /transformNames/$1
287
288//ldml/localeDisplayNames/types/type[@key="(%A)"][@type="(%A)"][@alt="(%A)"] ; /Types%$3/$1/$2
289//ldml/localeDisplayNames/types/type[@key="(%A)"][@type="(%A)"] ; /Types/$1/$2
290
291//ldml/localeDisplayNames/variants/variant[@type="(%A)"][@alt="(%A)"] ; /Variants%$2/$1
292//ldml/localeDisplayNames/variants/variant[@type="(%A)"] ; /Variants/$1
293
294# Numbers
295
296//ldml/numbers/currencies/currency[@type="(%A)"]/displayName[@count="(%A)"] ; /CurrencyPlurals/$1/$2
297
298//ldml/numbers/currencies/currency[@type="(%W)"]/symbol[@alt="(%A)"] ; /Currencies%$2/$1
299
300# ---- /Currencies/XXX bundles
301# Ordering of rules is critical here since they write into the same resource bundle path and the
302# last 3 values are grouped together as a single value (via the special <FIFO> hidden label).
303#
304# Note that the <FORMAT> label is needed here (not the "group" instruction) because the grouped
305# values must be seen as having a resource bundle path that is a child of the "/Currencies/$1"
306# path. This is so that the grouped values only appear when one of them is present rather than
307# whenever any of the other values in the main resource bundle path exists.
308#
309# Due to the optional nature of the final sub-array in the bundle, it would be very hard to ever
310# add any more elements after it.
311//ldml/numbers/currencies/currency[@type="(%W)"]/symbol
312     ; /Currencies/$1 ; fallback=$1
313//ldml/numbers/currencies/currency[@type="(%W)"]/displayName
314     ; /Currencies/$1 ; fallback=$1
315//ldml/numbers/currencies/currency[@type="(%W)"]/pattern[@type="standard"]
316     ; /Currencies/$1/<FORMAT> ; fallback=//ldml/numbers/currencyFormats[@numberSystem="%D"]/currencyFormatLength/currencyFormat[@type="standard"]/pattern[@type="standard"]
317//ldml/numbers/currencies/currency[@type="(%W)"]/decimal
318     ; /Currencies/$1/<FORMAT> ; fallback=//ldml/numbers/symbols[@numberSystem="%D"]/decimal
319//ldml/numbers/currencies/currency[@type="(%W)"]/group
320     ; /Currencies/$1/<FORMAT> ; fallback=//ldml/numbers/symbols[@numberSystem="%D"]/group
321# ----
322
323//ldml/numbers/currencyFormats[@numberSystem="%D"]/currencySpacing/(%W)/(%W)  ; /currencySpacing/$1/$2
324//ldml/numbers/currencyFormats[@numberSystem="%D"]/unitPattern[@count="(%W)"] ; /CurrencyUnitPatterns/$1
325
326//ldml/numbers/defaultNumberingSystem[@alt="(%A)"] ; /NumberElements/default_$1
327//ldml/numbers/defaultNumberingSystem              ; /NumberElements/default
328//ldml/numbers/minimumGroupingDigits               ; /NumberElements/minimumGroupingDigits
329//ldml/numbers/otherNumberingSystems/(%W)          ; /NumberElements/$1
330
331//ldml/numbers/symbols[@numberSystem="(%A)"]/(%W) ; /NumberElements/$1/symbols/$2
332//ldml/numbers/(%GFormat)s[@numberSystem="(%W)"]/\1Length/\1[@type="standard"]/pattern[@type="standard"][@alt="(%W)"] ; /NumberElements/$2/patterns/$1%$3
333//ldml/numbers/(%GFormat)s[@numberSystem="(%W)"]/\1Length/\1[@type="standard"]/pattern[@type="standard"] ; /NumberElements/$2/patterns/$1
334//ldml/numbers/currencyFormats[@numberSystem="(%W)"]/currencyFormatLength/currencyFormat[@type="accounting"]/pattern[@type="standard"][@alt="(%W)"] ; /NumberElements/$1/patterns/accountingFormat%$2
335//ldml/numbers/currencyFormats[@numberSystem="(%W)"]/currencyFormatLength/currencyFormat[@type="accounting"]/pattern[@type="standard"] ; /NumberElements/$1/patterns/accountingFormat
336//ldml/numbers/currencyFormats[@numberSystem="(%W)"]/currencyFormatLength[@type="short"]/currencyFormat[@type="standard"]/pattern[@type="(%N)"][@count="(%W)"][@alt="(%W)"] ; /NumberElements/$1/patternsShort/currencyFormat%$4/$2/$3
337//ldml/numbers/currencyFormats[@numberSystem="(%W)"]/currencyFormatLength[@type="short"]/currencyFormat[@type="standard"]/pattern[@type="(%N)"][@count="(%W)"] ; /NumberElements/$1/patternsShort/currencyFormat/$2/$3
338//ldml/numbers/currencyFormats[@numberSystem="(%W)"]/currencyPatternAppendISO  ; /NumberElements/$1/patterns/currencyPatternAppendISO
339//ldml/numbers/decimalFormats[@numberSystem="(%W)"]/decimalFormatLength[@type="short"]/decimalFormat[@type="standard"]/pattern[@type="(%N)"][@count="(%W)"] ; /NumberElements/$1/patternsShort/decimalFormat/$2/$3
340//ldml/numbers/decimalFormats[@numberSystem="(%W)"]/decimalFormatLength[@type="long"]/decimalFormat[@type="standard"]/pattern[@type="(%N)"][@count="(%W)"] ; /NumberElements/$1/patternsLong/decimalFormat/$2/$3
341
342//ldml/numbers/miscPatterns[@numberSystem="(%W)"]/pattern[@type="(%W)"] ; /NumberElements/$1/miscPatterns/$2
343//ldml/numbers/minimalPairs/caseMinimalPairs[@case="(%A)"] ; /NumberElements/minimalPairs/case/$1
344//ldml/numbers/minimalPairs/genderMinimalPairs[@gender="(%A)"] ; /NumberElements/minimalPairs/gender/$1
345//ldml/numbers/minimalPairs/ordinalMinimalPairs[@ordinal="(%A)"] ; /NumberElements/minimalPairs/ordinal/$1
346//ldml/numbers/minimalPairs/pluralMinimalPairs[@count="(%A)"] ; /NumberElements/minimalPairs/plural/$1
347
348# PersonNames
349# For namePattern, the alt value can just be 1 or 2.
350
351//ldml/personNames/nameOrderLocales[@order="(%A)"][@alt="(%A)"] ; /personNames/nameOrderLocales/$1%$2 ; values={value}
352//ldml/personNames/nameOrderLocales[@order="(%A)"]              ; /personNames/nameOrderLocales/$1 ; values={value}
353//ldml/personNames/foreignSpaceReplacement[@xml:space="(%A)"][@alt="(%A)"] ; /personNames/foreignSpaceReplacement%$2
354//ldml/personNames/foreignSpaceReplacement[@xml:space="(%A)"]              ; /personNames/foreignSpaceReplacement
355//ldml/personNames/foreignSpaceReplacement[@alt="(%A)"] ; /personNames/foreignSpaceReplacement%$1
356//ldml/personNames/foreignSpaceReplacement              ; /personNames/foreignSpaceReplacement
357//ldml/personNames/initialPattern[@type="(%A)"][@alt="(%A)"] ; /personNames/initialPattern/$1%$2
358//ldml/personNames/initialPattern[@type="(%A)"]              ; /personNames/initialPattern/$1
359//ldml/personNames/personName[@order="(%A)"][@length="(%A)"][@usage="(%A)"][@formality="(%A)"]/namePattern ;           /personNames/namePattern/$1-$2-$3-$4
360//ldml/personNames/personName[@order="(%A)"][@length="(%A)"][@usage="(%A)"][@formality="(%A)"]/namePattern[@alt="1"] ; /personNames/namePattern/$1-$2-$3-$4
361//ldml/personNames/personName[@order="(%A)"][@length="(%A)"][@usage="(%A)"][@formality="(%A)"]/namePattern[@alt="2"] ; /personNames/namePattern/$1-$2-$3-$4
362//ldml/personNames/personName[@order="(%A)"][@length="(%A)"][@usage="(%A)"][@formality="(%A)"]/alias[@source="locale"][@path="../personName[@order='(%A)'][@length='(%A)'][@usage='(%A)'][@formality='(%A)']"]
363     ; /personNames/namePattern/$1-$2-$3-$4:alias ; values=/LOCALE/personNames/namePattern/$5-$6-$7-$8
364
365# Misc
366
367# Ordering of rules is critical here since they write into the same resource bundle path.
368//ldml/contextTransforms/contextTransformUsage[@type="(%W)"]/contextTransform[@type="uiListOrMenu"] ; /contextTransforms/$1:intvector ; values=&context_transform_index({value}) ; fallback=0
369//ldml/contextTransforms/contextTransformUsage[@type="(%W)"]/contextTransform[@type="stand-alone"]  ; /contextTransforms/$1:intvector ; values=&context_transform_index({value}) ; fallback=0
370
371//ldml/delimiters/(%W) ; /delimiters/$1
372
373//ldml/layout/orientation/(%G)Order ; /layout/$1s
374
375//ldml/listPatterns/listPattern/listPatternPart[@type="(%A)"] ; /listPattern/standard/$1
376//ldml/listPatterns/listPattern[@type="(%A)"]/listPatternPart[@type="(%A)"] ; /listPattern/$1/$2
377
378//ldml/units/unitLength[@type="narrow"]/unit[@type="(\w++)-(%A)"]/displayName ; /unitsNarrow/$1/$2/dnam
379//ldml/units/unitLength[@type="short"]/unit[@type="(\w++)-(%A)"]/displayName ; /unitsShort/$1/$2/dnam
380//ldml/units/unitLength[@type="long"]/unit[@type="(\w++)-(%A)"]/displayName ; /units/$1/$2/dnam
381
382# TODO(icu-units#138): homogenize with compoundUnitPattern1 rules below by using "_" as case when case is absent in XML.
383//ldml/units/unitLength[@type="narrow"]/unit[@type="(\w++)-(%A)"]/unitPattern[@count="(%A)"][@case="(%A)"] ; /unitsNarrow/$1/$2/case/$4/$3
384//ldml/units/unitLength[@type="short"]/unit[@type="(\w++)-(%A)"]/unitPattern[@count="(%A)"][@case="(%A)"] ; /unitsShort/$1/$2/case/$4/$3
385//ldml/units/unitLength[@type="long"]/unit[@type="(\w++)-(%A)"]/unitPattern[@count="(%A)"][@case="(%A)"] ; /units/$1/$2/case/$4/$3
386//ldml/units/unitLength[@type="narrow"]/unit[@type="(\w++)-(%A)"]/unitPattern[@count="(%A)"] ; /unitsNarrow/$1/$2/$3
387//ldml/units/unitLength[@type="short"]/unit[@type="(\w++)-(%A)"]/unitPattern[@count="(%A)"] ; /unitsShort/$1/$2/$3
388//ldml/units/unitLength[@type="long"]/unit[@type="(\w++)-(%A)"]/unitPattern[@count="(%A)"] ; /units/$1/$2/$3
389
390//ldml/units/unitLength[@type="narrow"]/unit[@type="(\w++)-(%A)"]/gender ; /unitsNarrow/$1/$2/gender
391//ldml/units/unitLength[@type="short"]/unit[@type="(\w++)-(%A)"]/gender ; /unitsShort/$1/$2/gender
392//ldml/units/unitLength[@type="long"]/unit[@type="(\w++)-(%A)"]/gender ; /units/$1/$2/gender
393
394//ldml/units/unitLength[@type="narrow"]/compoundUnit[@type="(%A)"]/compoundUnitPattern[@case="(%A)"] ; /unitsNarrow/compound/$1
395//ldml/units/unitLength[@type="short"]/compoundUnit[@type="(%A)"]/compoundUnitPattern[@case="(%A)"] ; /unitsShort/compound/$1
396//ldml/units/unitLength[@type="long"]/compoundUnit[@type="(%A)"]/compoundUnitPattern[@case="(%A)"] ; /units/compound/$1/
397//ldml/units/unitLength[@type="narrow"]/compoundUnit[@type="(%A)"]/compoundUnitPattern ; /unitsNarrow/compound/$1
398//ldml/units/unitLength[@type="short"]/compoundUnit[@type="(%A)"]/compoundUnitPattern ; /unitsShort/compound/$1
399//ldml/units/unitLength[@type="long"]/compoundUnit[@type="(%A)"]/compoundUnitPattern ; /units/compound/$1
400
401# TODO(icu-units#138): the style of output paths used in these rules is the proposed format for all count/gender/case lateral inheritance rules.
402//ldml/units/unitLength[@type="narrow"]/compoundUnit[@type="(%A)"]/compoundUnitPattern1[@count="(%A)"][@gender="(%A)"][@case="(%A)"] ; /unitsNarrow/compound/$1/$2/$3/$4
403//ldml/units/unitLength[@type="short"]/compoundUnit[@type="(%A)"]/compoundUnitPattern1[@count="(%A)"][@gender="(%A)"][@case="(%A)"] ; /unitsShort/compound/$1/$2/$3/$4
404//ldml/units/unitLength[@type="long"]/compoundUnit[@type="(%A)"]/compoundUnitPattern1[@count="(%A)"][@gender="(%A)"][@case="(%A)"] ; /units/compound/$1/$2/$3/$4
405//ldml/units/unitLength[@type="narrow"]/compoundUnit[@type="(%A)"]/compoundUnitPattern1[@count="(%A)"][@case="(%A)"] ; /unitsNarrow/compound/$1/$2/_/$3
406//ldml/units/unitLength[@type="short"]/compoundUnit[@type="(%A)"]/compoundUnitPattern1[@count="(%A)"][@case="(%A)"] ; /unitsShort/compound/$1/$2/_/$3
407//ldml/units/unitLength[@type="long"]/compoundUnit[@type="(%A)"]/compoundUnitPattern1[@count="(%A)"][@case="(%A)"] ; /units/compound/$1/$2/_/$3
408//ldml/units/unitLength[@type="narrow"]/compoundUnit[@type="(%A)"]/compoundUnitPattern1[@count="(%A)"][@gender="(%A)"] ; /unitsNarrow/compound/$1/$2/$3/_
409//ldml/units/unitLength[@type="short"]/compoundUnit[@type="(%A)"]/compoundUnitPattern1[@count="(%A)"][@gender="(%A)"] ; /unitsShort/compound/$1/$2/$3/_
410//ldml/units/unitLength[@type="long"]/compoundUnit[@type="(%A)"]/compoundUnitPattern1[@count="(%A)"][@gender="(%A)"] ; /units/compound/$1/$2/$3/_
411//ldml/units/unitLength[@type="narrow"]/compoundUnit[@type="(%A)"]/compoundUnitPattern1[@count="(%A)"] ; /unitsNarrow/compound/$1/$2/_/_
412//ldml/units/unitLength[@type="short"]/compoundUnit[@type="(%A)"]/compoundUnitPattern1[@count="(%A)"] ; /unitsShort/compound/$1/$2/_/_
413//ldml/units/unitLength[@type="long"]/compoundUnit[@type="(%A)"]/compoundUnitPattern1[@count="(%A)"] ; /units/compound/$1/$2/_/_
414
415//ldml/units/unitLength[@type="narrow"]/compoundUnit[@type="(%A)"]/unitPrefixPattern ; /unitsNarrow/compound/$1
416//ldml/units/unitLength[@type="short"]/compoundUnit[@type="(%A)"]/unitPrefixPattern ; /unitsShort/compound/$1
417//ldml/units/unitLength[@type="long"]/compoundUnit[@type="(%A)"]/unitPrefixPattern ; /units/compound/$1
418
419//ldml/units/unitLength[@type="narrow"]/coordinateUnit/displayName ; /unitsNarrow/coordinate/dnam
420//ldml/units/unitLength[@type="short"]/coordinateUnit/displayName ; /unitsShort/coordinate/dnam
421//ldml/units/unitLength[@type="long"]/coordinateUnit/displayName ; /units/coordinate/dnam
422
423//ldml/units/unitLength[@type="narrow"]/coordinateUnit/coordinateUnitPattern[@type="(%A)"] ; /unitsNarrow/coordinate/$1
424//ldml/units/unitLength[@type="short"]/coordinateUnit/coordinateUnitPattern[@type="(%A)"] ; /unitsShort/coordinate/$1
425//ldml/units/unitLength[@type="long"]/coordinateUnit/coordinateUnitPattern[@type="(%A)"] ; /units/coordinate/$1
426
427//ldml/units/unitLength[@type="narrow"]/unit[@type="(\w++)-(%A)"]/perUnitPattern ; /unitsNarrow/$1/$2/per
428//ldml/units/unitLength[@type="short"]/unit[@type="(\w++)-(%A)"]/perUnitPattern ; /unitsShort/$1/$2/per
429//ldml/units/unitLength[@type="long"]/unit[@type="(\w++)-(%A)"]/perUnitPattern ; /units/$1/$2/per
430
431//ldml/units/durationUnit[@type="(%A)"]/durationUnitPattern ; /durationUnits/$1
432
433//ldml/units/unitLength[@type="narrow"]/unit[@type="(\w++)-(%A)"]/alias[@source="locale"][@path="../unit[@type='(\w++)-(%A)']"] ; /unitsNarrow/$1/$2:alias ; values=/LOCALE/unitsNarrow/$3/$4
434//ldml/units/unitLength[@type="short"]/unit[@type="(\w++)-(%A)"]/alias[@source="locale"][@path="../unit[@type='(\w++)-(%A)']"] ; /unitsShort/$1/$2:alias ; values=/LOCALE/unitsShort/$3/$4
435//ldml/units/unitLength[@type="long"]/unit[@type="(\w++)-(%A)"]/alias[@source="locale"][@path="../unit[@type='(\w++)-(%A)']"] ; /units/$1/$2:alias ; values=/LOCALE/units/$3/$4
436
437//ldml/characterLabels/characterLabelPattern[@type="(%A)"][@count="(%A)"] ; /characterLabelPattern/$1/$2
438//ldml/characterLabels/characterLabelPattern[@type="(%A)"] ; /characterLabelPattern/$1
439//ldml/characterLabels/characterLabel[@type="(%A)"] ; /characterLabel/$1
440