# Data-driven file for mapping LDML paths to ICU paths.
# order is important!
# Format is:
# ldmlRegex ; directory ; icuPath ; extraPaths
# Each regex pattern is transformed by the following before use: "^" + source.replace("[@", "\\[@") + "$"
# Each icuPath is prefixed by the file name (eg /en).
# Items not in ICU 4.8 are in 'extras'
# extraPaths are optional. If one occurs, then it is a regex for extra paths to be added from the fully-resolved file. The value '=' means use the ldmlPath.

# Variables
# Attribute value
%A=[^"']*
# Element value
%E=[^/\[]*

# Main locale data

# Aliases

//ldml/dates/calendars/calendar[@type="(%A)"]/dayPeriods/alias[@source="locale"][@path="../../calendar[@type='(%A)']/dayPeriods"] ; locales ; /calendar/$1/AmPmMarkers:alias ; values=/LOCALE/calendar/$2/AmPmMarkers

//ldml/dates/calendars/calendar[@type="(%A)"]/eras/eraNarrow/alias[@source="locale"][@path="../eraAbbr"] ; locales ; /calendar/$1/eras/narrow:alias ; values=/LOCALE/calendar/$1/eras/abbreviated
//ldml/dates/calendars/calendar[@type="(%A)"]/eras/eraWide/alias[@source="locale"][@path="../eraAbbr"] ; locales ; /calendar/$1/eras/wide:alias ; values=/LOCALE/calendar/$1/eras/abbreviated
//ldml/dates/calendars/calendar[@type="(%A)"]/eras/eraNames/alias[@source="locale"][@path="../eraAbbr"] ; locales ; /calendar/$1/eras/wide:alias ; values=/LOCALE/calendar/$1/eras/abbreviated

//ldml/dates/calendars/calendar[@type="(%A)"]/dateTimeFormats/(%E)/alias[@source="locale"][@path="../../../calendar[@type='(%A)']/dateTimeFormats/\2"] ; locales ; /calendar/$1/\2:alias ; values=/LOCALE/calendar/gregorian/\2

//ldml/dates/calendars/calendar[@type="(%A)"]/(%E)Formats/alias[@source="locale"][@path="../../calendar[@type='(%A)']/(?:%E)Formats] ; locales ; /calendar/$1/$2:alias ; values=/LOCALE/calendar/$3/$2

//ldml/dates/calendars/calendar[@type="(%A)"]/(%E)s/(?:%E)[@type="(%A)"]/(?:%E)[@type="(%A)"]/alias[@source="locale"][@path="../../(?:%E)[@type='(%A)']/(?:%E)[@type='(%A)']"] ; locales ; /calendar/$1/$2Names/$3/$4:alias ; values=/LOCALE/calendar/$1/$2Names/$5/$6
//ldml/dates/calendars/calendar[@type="(%A)"]/(%E)s/(?:%E)[@type="(%A)"]/(?:%E)[@type="(%A)"]/alias[@source="locale"][@path="../(?:%E)[@type='(%A)']"] ; locales ; /calendar/$1/$2Names/$3/$4:alias ; values=/LOCALE/calendar/$1/$2Names/$3/$5

//ldml/dates/calendars/calendar[@type="(%A)"]/quarters/alias[@source="locale"][@path="../../(?:%E)[@type='(%A)']/(?:%E)"] ; locales ; /calendar/$1/quarters:alias ; values=/LOCALE/calendar/$2/quarters
//ldml/dates/calendars/calendar[@type="(%A)"]/(month|day)s/alias[@source="locale"][@path="../../(?:%E)[@type='(%A)']/(?:%E)"] ; locales ; /calendar/$1/$2Names:alias ; values=/LOCALE/calendar/$3/$2Names

//ldml/dates/calendars/calendar[@type="(%A)"]/alias[@source="locale"][@path="../calendar[@type='(%A)']"]   ; locales ; /calendar/$1:alias ; values=/LOCALE/calendar/$2

//ldml/dates/calendars/calendar[@type="(%A)"]/(dateTime|date|time)Formats/alias[@source="locale"][@path="../../calendar[@type='(%A)']/(?:%E)"]   ; locales ; /calendar/$1/$2:alias ; values=/LOCALE/calendar/$3/$2

#//ldml/dates/calendars/calendar[@type="(%A)"]/dayPeriods/dayPeriodContext[@type="(%A)"]/alias[@source="locale"][@path="(%A)"]   ; locales ; /dates/calendars/calendar[@type="gregorian"]/dayPeriods/dayPeriodContext[@type="stand-alone"]/alias[@source="locale"][@path="../dayPeriodContext[@type='format']"]

# Defaults

//ldml/dates/calendars/default[@choice="(%A)"]   ; extras ; /calendar/default ; values=$1
//ldml/dates/calendars/calendar[@type="(%A)"]/(dateTime|date|time)Formats/default[@choice="(%A)"]   ; extras ; /calendar/$1/$2/default ; values=$3

//ldml/dates/calendars/calendar[@type="(%A)"]/(month|day)s/default[@choice="(%A)"] ; locales ; /calendar/$1/$2Names/default  ; values=$3
//ldml/dates/calendars/calendar[@type="(%A)"]/(month|day)s/(?:%E)[@type="(%A)"]/default[@choice="(%A)"] ; locales ; /calendar/$1/$2Names/$3/default  ; values=$4

# Dates

//ldml/dates/calendars/calendar[@type="(%A)"]/eras/eraNarrow/era[@type="(%A)"] ; locales ; /calendar/$1/eras/narrow
//ldml/dates/calendars/calendar[@type="(%A)"]/eras/eraAbbr/era[@type="(%A)"] ; locales ; /calendar/$1/eras/abbreviated
//ldml/dates/calendars/calendar[@type="(%A)"]/eras/eraNames/era[@type="(%A)"] ; locales ; /calendar/$1/eras/wide

//ldml/dates/calendars/calendar[@type="(%A)"]/dayPeriods/dayPeriodContext[@type="format"]/dayPeriodWidth[@type="wide"]/dayPeriod[@type="(am|pm)"] ; locales ; /calendar/$1/AmPmMarkers
//ldml/dates/calendars/calendar[@type="(%A)"]/dayPeriods/dayPeriodContext[@type="(%A)"]/dayPeriodWidth[@type="(%A)"]/dayPeriod[@type="(%A)"] ; extras ; /calendar/$1/AmPmMarkers-extra/$2/$3
//ldml/dates/calendars/calendar[@type="(%A)"]/dayPeriods/dayPeriodContext[@type="(%A)"]/dayPeriodWidth[@type="(%A)"]/dayPeriod[@type="(%A)"][@alt="(%A)"] ; extras ; /calendar/$1/AmPmMarkers-$4/$2/$3

# //ldml/dates/calendars/calendar[@type=xxx]/dateFormats/dateFormatLength[@type="full"/dateFormat/pattern

//ldml/dates/calendars/calendar[@type="(%A)"]/(dateTime|date|time)Formats/(?:%E)[@type="(?:%A)"]/(?:%E)[@type="(?:%A)"]/pattern[@type="(?:%A)"] ; locales ; /calendar/$1/DateTimePatterns ; //ldml/dates/calendars/calendar[@type="$1"]/(dateTime|date|time)Formats/(?:%E)[@type="(?:%A)"]/(?:%E)[@type="(?:%A)"]/pattern[@type="(?:%A)"]

#//ldml/dates/calendars/calendar[@type="hebrew"]/months/monthContext[@type="format"]/monthWidth[@type="wide"]/month[@type="7"][@yeartype="leap"]

//ldml/dates/calendars/calendar[@type="(%A)"]/(quarters)/(?:%E)[@type="(%A)"]/(?:%E)[@type="(%A)"]/(?:%E)[@type="(?:%A)"] ; locales ; /calendar/$1/$2/$3/$4
//ldml/dates/calendars/calendar[@type="(%A)"]/(%E)s/(?:%E)[@type="(%A)"]/(?:%E)[@type="(%A)"]/(?:%E)[@type="(?:%A)"][@alt="(%A)"] ; locales ; /calendar/$1/$2Names-$5/$3/$4
//ldml/dates/calendars/calendar[@type="(%A)"]/(%E)s/(?:%E)[@type="(%A)"]/(?:%E)[@type="(%A)"]/(?:%E)[@type="(?:%A)"][@yeartype="(%A)"] ; locales ; /calendar/$1/$2Names/$3/$4
//ldml/dates/calendars/calendar[@type="(%A)"]/(%E)s/(?:%E)[@type="(%A)"]/(?:%E)[@type="(%A)"]/(?:%E)[@type="(?:%A)"] ; locales ; /calendar/$1/$2Names/$3/$4

//ldml/dates/calendars/calendar[@type="(%A)"]/fields/field[@type="(%A)"]/displayName ; locales ; /calendar/$1/fields/$2/dn
//ldml/dates/calendars/calendar[@type="(%A)"]/fields/field[@type="(%A)"]/relative[@type="(%A)"] ; locales ; /calendar/$1/fields/$2/relative/$3

//ldml/dates/calendars/calendar[@type="(%A)"]/dateTimeFormats/availableFormats/dateFormatItem[@id="(%A)"] ; locales ; /calendar/$1/availableFormats/$2

//ldml/dates/calendars/calendar[@type="(%A)"]/dateTimeFormats/intervalFormats/intervalFormatItem[@id="(%A)"]/greatestDifference[@id="(%A)"] ; locales ; /calendar/$1/intervalFormats/$2/$3

//ldml/dates/calendars/calendar[@type="(%A)"]/dateTimeFormats/intervalFormats/intervalFormatFallback ; locales ; /calendar/$1/intervalFormats/fallback

//ldml/dates/dateRangePattern ; extras ; /dateRangePattern

//ldml/dates/calendars/calendar[@type="(%A)"]/dateTimeFormats/appendItems/appendItem[@request="(%A)"] ; locales ; /calendar/$1/appendItems/$2


# Characters

//ldml/characters/exemplarCharacters[@type="auxiliary"] ; locales ; /AuxExemplarCharacters
//ldml/characters/exemplarCharacters[@type="currencySymbol"] ; locales ; /ExemplarCharactersCurrency
//ldml/characters/exemplarCharacters[@type="index"] ; locales ; /ExemplarCharactersIndex
//ldml/characters/exemplarCharacters[@type="punctuation"] ; locales ; /ExemplarCharactersPunctuation
//ldml/characters/exemplarCharacters ; locales ; /ExemplarCharacters

//ldml/characters/ellipsis[@type="(%A)"] ; extras ; /ellipsis/$1

# Numbers

//ldml/numbers/defaultNumberingSystem ; locales ; /NumberElements/default

//ldml/numbers/symbols[@numberSystem="(%A)"]/alias[@source="locale"][@path="../symbols[@numberSystem='(%A)']"] ; extras ; /NumberElements/$1/symbols:alias ; values=/LOCALE/NumberElements/$2/symbols

//ldml/numbers/symbols[@numberSystem="(%A)"]/(%E) ; locales ; /NumberElements/$1/symbols/$2
//ldml/numbers/(%E)s/(?:%E)Length/(?:%E)Format[@type="standard"]/pattern[@type="standard"] ; locales ; /NumberElements/latn/patterns/$1

//ldml/numbers/(%E)s/(?:%E)Length[@type="short"]/(?:%E)Format[@type="standard"]/pattern[@type="(%A)"] ; extras ; /NumberElements/latn/pattern/$1-short/$2

# Other

//ldml/units/unit[@type="(%A)"]/unitPattern[@count="(%A)"][@alt="short"] ; locales ; /unitsShort/$1/$2
//ldml/units/unit[@type="(%A)"]/unitPattern[@count="(%A)"] ; locales ; /units/$1/$2

//ldml/localeDisplayNames/measurementSystemNames/measurementSystemName[@type="(%A)"] ; locales ; /measurementSystemNames/$1

//ldml/listPatterns/listPattern/listPatternPart[@type="(%A)"] ; locales ; /listPattern/standard/$1

//ldml/delimiters/(%E) ; locales ; /delimiters/$1

# Language directory

//ldml/localeDisplayNames/keys/key[@type="(%A)"] ; lang ; /Keys/$1

//ldml/localeDisplayNames/types/type[@type="(colAlternate|colBackwards|colCaseFirst|colCaseLevel|colHiraganaQuaternary|colNormalization|colNumeric|colStrength)"][@key="(%A)"] ; extras ; /Types/$2/$1

//ldml/localeDisplayNames/types/type[@type="(%A)"][@key="(%A)"] ; lang ; /Types/$2/$1
//ldml/localeDisplayNames/codePatterns/codePattern[@type="(%A)"] ; lang ; /codePatterns/$1

//ldml/localeDisplayNames/languages/language[@type="(%A)"][@alt="short"] ; lang ; /LanguagesShort/$1

//ldml/localeDisplayNames/languages/language[@type="(%A)"][@alt="(%A)"] ; extras ; /Languages-$2/$1
//ldml/localeDisplayNames/scripts/script[@type="(%A)"][@alt="(%A)"] ; extras ; /Scripts-$2/$1

//ldml/localeDisplayNames/languages/language[@type="(%A)"] ; lang ; /Languages/$1
//ldml/localeDisplayNames/scripts/script[@type="(%A)"] ; lang ; /Scripts/$1
//ldml/localeDisplayNames/variants/variant[@type="(%A)"] ; lang ; /Variants/$1

//ldml/localeDisplayNames/localeDisplayPattern/localePattern ; lang ; /localeDisplayPattern/pattern
//ldml/localeDisplayNames/localeDisplayPattern/localeSeparator ; lang ; /localeDisplayPattern/separator

//ldml/localeDisplayNames/transformNames/transformName[@type="(%A)"] ; extras ; /transformName/$1

# Region directory

//ldml/localeDisplayNames/territories/territory[@type="(%A)"][@alt="(%A)"] ; extras ; /Countries-$2/$1

//ldml/localeDisplayNames/territories/territory[@type="(%A)"] ; region ; /Countries/$1

# Currency directory

//ldml/numbers/currencies/currency[@type="(%A)"]/displayName[@count="(%A)"] ; curr ; /CurrencyPlurals/$1/$2

//ldml/numbers/currencies/currency[@type="(%A)"]/(displayName|symbol) ; curr ; /Currencies/$1 ; =

//ldml/numbers/currencyFormats/unitPattern[@count="(%A)"] ; curr ; /CurrencyUnitPatterns/$1

# Zone directory

//ldml/dates/timeZoneNames/metazone[@type="(%A)"]/([^/\[])(?:%E)/([^/\[])(?:%E) ; zone ; /zoneStrings/meta:$1/$2$3
//ldml/dates/timeZoneNames/metazone[@type="(%A)"]/commonlyUsed ; zone ; /zoneStrings/meta:$1/cu:int

//ldml/dates/timeZoneNames/zone[@type="(%A)/(%A)"]/([^/\[])(?:%E)/([^/\[])(?:%E) ; zone ; /zoneStrings/$1:$2/$3$4
//ldml/dates/timeZoneNames/zone[@type="(%A)"]/([^/\[])(?:%E)/([^/\[])(?:%E) ; zone ; /zoneStrings/$1/$2$3

//ldml/dates/timeZoneNames/zone[@type="(%A)/(%A)/(%A)"]/exemplarCity ; zone ; /zoneStrings/$1:$2:$3/ec
//ldml/dates/timeZoneNames/zone[@type="(%A)/(%A)"]/exemplarCity ; zone ; /zoneStrings/$1:$2/ec
//ldml/dates/timeZoneNames/zone[@type="(%A)"]/exemplarCity ; zone ; /zoneStrings/$1/ec

//ldml/dates/timeZoneNames/singleCountries[@list="(%A)"] ; zone ; /zoneStrings/singleCountries ; values=$1

//ldml/dates/timeZoneNames/(region|fallbackRegion|fallback|gmtZero|gmt)Format   ; zone ; /zoneStrings/$1

# Other Extras

//ldml/layout/inText[@type="(%A)"] ; extras ; /layout/inText/$1

//ldml/identity/version[@number="(%A)"][@cldrVersion="(%A)"]   ; extras ; /identity/versions/$2 ; values=$1
//ldml/identity/generation[@date="(%A)"]   ; extras ; /identity/generation ; values=$1
//ldml/identity/language[@type="(%A)"]   ; extras ;  /identity/language ; values=$1
//ldml/fallback   ; extras ;  /fallback
//ldml/localeDisplayNames/localeDisplayPattern/localeKeyTypePattern   ; extras ; /localeKeyTypePattern
//ldml/layout/orientation[@lines="(%A)"][@characters="(%A)"]   ; extras ; /layout/orientation ; values=$1 $2
//ldml/layout/inList   ; extras ; /layout/inList
//ldml/characters/moreInformation   ; extras ; /characters/moreInformation
//ldml/characters/stopwords/stopwordList[@type="(%A)"]   ; extras ; /characters/stopwordList/$1

//ldml/dates/timeZoneNames/hourFormat   ; extras ; /zoneHourFormat
//ldml/numbers/currencyFormats/currencySpacing/beforeCurrency/currencyMatch   ; extras ; /currency/beforeMatch
//ldml/numbers/currencyFormats/currencySpacing/beforeCurrency/surroundingMatch   ; extras ; /currency/beforeSurroundingMatch
//ldml/numbers/currencyFormats/currencySpacing/beforeCurrency/insertBetween   ; extras ; /currency/beforeInsertBetween
//ldml/numbers/currencyFormats/currencySpacing/afterCurrency/currencyMatch   ; extras ; /currency/afterMatch
//ldml/numbers/currencyFormats/currencySpacing/afterCurrency/surroundingMatch   ; extras ; /currency/afterSurroundingMatch
//ldml/numbers/currencyFormats/currencySpacing/afterCurrency/insertBetween   ; extras ; /currency/afterInsertBetween
//ldml/posix/messages/yesstr   ; extras ; /posixYesstr
//ldml/posix/messages/nostr   ; extras ; /posixNostr

