Skip to main content
May 23, 2006

Internationalizing XML

Via Cafe con Leche (Elliotte Rusty Harold), the first public working draft of Best Practices for XML Internationalization has been released by the W3C Internalization Tag Set Working Group.

The document

provides best practices and techniques related to the internationalization of XML that developers of XML applications as well as content authors can use to ensure that their XML documents and schemas are easily adaptable for an international audience. These are practices and techniques that are best addressed from the start of content development if unnecessary costs and resource issues are to be avoided later on.

The item certain to cause the most discussion (and Cafe con Leche flagged this as well) is the recommendation to avoid translatable attributes. The authors illustrate this with a typical <image/> tag with src (file) and alt (alternate text) attributes. They recommend putting the alt text as the text of the image element:

<image src=”elephants.png”>Elephants bathing in the Zambezi River.&lt/image>

I don’t see an easy way to reconcile accessibility and internationalization concerns. The alt attribute allows an author to specify alternate rendering for an image to provide a second way of getting information. Generally, the intent is to provide the alternate text only when the content consumer cannot use the primary delivery mechanism (in this case, the graphic). Placing the alternate text in an attribute captures the logical relationship between the image and the alternate text very accurately. The example shown above looks more like a caption to me. I suppose you could make your XML more complex with something like the following:

<image><alt>This text describes file.gif.&lt/alt></image>

The alt text attribute is familiar from HTML, so the recommendation to avoid it will take some getting used to.