[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: parsing and translating xml:lang attribute

Subject: RE: parsing and translating xml:lang attribute
From: Kay Michael <Michael.Kay@xxxxxxx>
Date: Wed, 25 Oct 2000 10:05:39 +0100
mapping using xsl
> The second issue is that the values for this attribute are 
> conforming to
> the two-digit language abbreviations according to ISO 639, 
> but my target
> DTD uses three-digit language strings according to ISO 639-2 
> (e. g. 'de'
> would be translated into 'ger'). I do have a list of both, 
> but I wonder how
> to technically best achieve the mapping using XSL.

Can't help you with your first problem, but for the second, try using a
look-up table in a separate document languages.xml:

<languages>
<language a2="de" a3="ger"/>
etc
</languages> 

Then write
<xsl:key name="langkey" match="language" use="@a2">

and

<xsl:for-each select="document('language.xml')">
<xsl:value-of select="key('langkey', $two-letter-code)/@a3"/>
</xsl:for-each>

to get the three letter code.

Mike Kay


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.