How to use xml:lang? (was: DDML Documentation Capabilities)

David Megginson david at megginson.com
Thu Jan 28 15:20:52 GMT 1999


[sorry for the late reply]

Jarle Stabell writes:

 > One question (not about DDML in particular) regarding how to best use 
 > xml:lang:
 > 
 > Should the DDML look something like:
 > 
 > <Title xml:lang="de">
 > Title in german
 > </Title>
 > <Desc xml:lang="de">
 > Description in german
 > </Desc>
 > <Title xml:lang="en">
 > Title in english
 > </Title>
 > <Desc xml:lang="en">
 > Description in english
 > </Desc>

This is passable, if a little ugly -- it keeps things simple enough
that it's probably what DDML needs.

 > or should one use something similar to:
 > 
 > <Title>
 > <if xml:lang="de">Title in german</if><if xml:lang="en">Title in 
 > english</if>....
 > </Title>
 > <Desc>
 > <if xml:lang="de">Description in german</if><if xml:lang="en">Description 
 > in english</if>
 > </Desc>

You certainly shouldn't use this one -- it looks too much like
procedural code rather than descriptive markup.  Here's a clean and
elegant (but verbose) way to handle it descriptively:

<Title>
<text xml:lang="es">Pedido</text>
<text xml:lang="en">Order</text>
<text xml:lang="de">Order</text>
</Title>

The question is whether you always want to require a <text> subelement.


All the best,


David

-- 
David Megginson                 david at megginson.com
           http://www.megginson.com/

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)




More information about the Xml-dev mailing list