Skip to content

Commit cd5034f

Browse files
committed
Tools: add a XSL to create the Windows/Olson mapping
Since Windows uses its own names for timezones, the Unicode corsotium provides the canonical mapping for the timezones. Use the Unicode CLDR to generate the mapping plist requires transformation, which this XSLT provides.
1 parent 8866dc6 commit cd5034f

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
This XSL transforms the Windows Timezone list from the Unicode CLDR to a plist
4+
which is consumable by CoreFoundation. You need to fetch the lastest mapping
5+
from the Unicode consortium from:
6+
https://unicode.org/repos/cldr/trunk/common/supplemental/windowsZones.xml
7+
The XSL can be applied to this data via the `xsltproc` command.
8+
Running
9+
`xsltproc &dash;&dash;noverify WindowsOlsonDatabase.xsl windowsZones.xml`
10+
will generate the mapping plist.
11+
-->
12+
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
13+
<xsl:output encoding="utf-8" indent="yes" />
14+
15+
<xsl:template match="/">
16+
<xsl:text disable-output-escaping="yes">&lt;!DOCTYPE plist SYSTEM "file:///localhost/System/Library/DTDs/PropertyList.dtd"&gt;
17+
</xsl:text>
18+
<plist version="1.0">
19+
<dict>
20+
<xsl:for-each select="supplementalData/windowsZones/mapTimezones/mapZone[@territory='001']">
21+
<key><xsl:value-of select="@type" /></key>
22+
<string><xsl:value-of select="@other" /></string>
23+
</xsl:for-each>
24+
</dict>
25+
</plist>
26+
</xsl:template>
27+
</xsl:stylesheet>

0 commit comments

Comments
 (0)