Re: XML and Internationalization...

Deke Smith (david@megginson.com)
Mon, 9 Nov 1998 09:54:13 -0500 (EST)


Deke Smith writes:

> I would suggest one change to your syntax: there is a standard tag
> for language specification in XML. That tag is "xml:lang" and it
> uses ISO 639 language codes. You can find the language codes at <
> http://www.isoc.org:8080/langues/iso639.fr.htm>.

One important point to note is that by itself, the 'xml:lang'
attribute simply indicates the language of the content and attribute
values -- it does not suggest that sibling elements with different
xml:lang values either are or are not equivalents in other languages.
For example, I could have

<itinerary>
<city xml:lang=3D"fr">Montr&#233;al</city>
<city xml:lang=3D"en">London</city>
<city xml:lang=3D"it">Roma</city>
</itinerary>

where the three elements are clearly not alternate versions of the
same thing.

> <method id=3D"fact">
>=20
> <description xml:lang =3D"en">The factorial method</description>=

> <description xml:lang =3D"fr">La m=E9thode factorielle</descript=
ion>
> <description xml:lang =3D"es">La operac=EDon factorial</descript=
ion>
>=20
> <param id=3D"Nbr" mode=3D"in" type=3D"int">
> <description xml:lang =3D"en">The number to pass in</descrip=
tion>
> <description xml:lang =3D"fr">Le nombre =E0 passer</descript=
ion>
> <description xml:lang =3D"es">El n=FAmero a calcular</descri=
ption>
> </param>
>=20
> </method>
> ....

This example is perfectly reasonable, as long as you remember that the
idea that the description elements represent the same thing in
different languages is derived from the document type (or vocabulary),=20=

not from the 'xml:lang' attribute itself. As far as 'xml:lang' is
concerned, you could just as easily have

<description xml:lang=3D"en">The</description>
<description xml:lang=3D"fr">m&#233;thode</description>
<description xml:lang=3D"es">factorial</description>

where all three make up the same description.

All the best,

David

--=20
David Megginson david@megginson.com
http://www.megginson.com/