Ticket #68 (closed defect: fixed)
Process <alias> elements in CLDR files
| Reported by: | cmlenz | Owned by: | cmlenz |
|---|---|---|---|
| Priority: | critical | Milestone: | 0.9.3 |
| Component: | CLDR Import | Version: | 0.9.1 |
| Keywords: | Cc: |
Description
Lots of locale data in the CLDR XML files isn't repeated, but instead referred to via <alias> elements. We don't currently process those, which means that some data is missing.
One problem is that <alias> uses XPath, and no part of the standard library supports that, unfortunately. We could use lxml or try to take apart the XPaths manually, but both seem suboptimal. Requiring lxml might work if the results of the import process were in the repository.
Attachments
Change History
comment:2 Changed 4 years ago by jarek.zgoda@…
I found some Perl module on CPAN that handles aliases in CLDR files: http://search.cpan.org/src/DROLSKY/DateTime-Locale-0.35/tools/generate_from_cldr.
I'll check if it could be of any purpose here.
Changed 4 years ago by cmlenz
- Attachment cldr_aliases.diff added
In-progress patch for alias support
comment:4 Changed 4 years ago by cmlenz
- Status changed from new to assigned
I've added an incomplete patch that adds some alias processing.
The basic approach is that while locale inheritance is still done when loading locale data files, aliases are resolved when items are accessed. The pickle files store Alias instances. Locale data access is wrapped in an AliasResolvingDict instance.
Changed 4 years ago by cmlenz
- Attachment cldr_aliases.2.diff added
New patch, improved and reasonably complete

How about pre-processing CLDR with XSLT to get plain, parseable XML, eg. using some external XSL processor, like xsltproc, sablotron or xalan?