diff --git a/util/locale_database/qlocalexml.py b/util/locale_database/qlocalexml.py index ae1748fba64..73bc6dd526d 100644 --- a/util/locale_database/qlocalexml.py +++ b/util/locale_database/qlocalexml.py @@ -111,9 +111,10 @@ class QLocaleXmlReader (object): yield (language, script, territory), locale def aliasToIana(self): - kid = self.__firstChildText + def attr(elt, key): + return elt.attributes[key].nodeValue for elt in self.__eachEltInGroup(self.root, 'zoneAliases', 'zoneAlias'): - yield kid(elt, 'alias'), kid(elt, 'iana') + yield attr(elt, 'alias'), attr(elt, 'iana') def msToIana(self): kid = self.__firstChildText @@ -421,10 +422,7 @@ class QLocaleXmlWriter (object): for name, iana in sorted(alias.items()): if name == iana: continue - self.__openTag('zoneAlias') - self.inTag('alias', name) - self.inTag('iana', iana) - self.__closeTag('zoneAlias') + self.asTag('zoneAlias', alias = name, iana = iana) self.__closeTag('zoneAliases') self.__openTag('windowsZone') diff --git a/util/locale_database/qlocalexml.rnc b/util/locale_database/qlocalexml.rnc index 123fe3fd04c..996540171d4 100644 --- a/util/locale_database/qlocalexml.rnc +++ b/util/locale_database/qlocalexml.rnc @@ -41,8 +41,8 @@ LocaleTriplet = ( # TODO: xsd patterns for IANA IDs and space-joined lists of them ZoneAlias = element zoneAlias { - element alias { text }, - element iana { text } + attribute alias { text }, + attribute iana { text } } MsLandZones = element msLandZones {