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

Re: multi language support

Subject: Re: multi language support
From: Jeni Tennison <Jeni.Tennison@xxxxxxxxxxxxxxxx>
Date: Thu, 25 May 2000 10:45:14 +0100
xsl while test example
Alankar,

At 09:52 AM 5/25/00 +0200, Sydney wrote:
>To support multi-language, you can use something like
>that
>
><pagecontent>
><desc xml:lang="fr">Bonjour</desc>
><desc xml:lang="en">Hello</desc>
></pagecontent>
>
>When you use xslt, you specify the language as a
>parameter of your xsl file.
><xsl:stylesheet>
><xsl:param name="lang"/>

Just to follow on from Sydney's suggestion, you should use the lang()
function as a shortcut to test whether the language specified in your
document using the xml:lang attribute matches the language specified by the
$lang parameter.  This saves you from having to test for different
capitalisations or subcodes like 'en-GB' in the value of the xml:lang
attribute.  More importantly, it takes into account the fact that xml:lang
is an attribute that is inherited by child elements.  For example:

<xsl:template match="desc">
  <xsl:if test="lang($lang)">
    <xsl:copy-of select="." />
  </xsl:if>
</xsl:template>

Cheers,

Jeni

Dr Jeni Tennison
Epistemics Ltd, Strelley Hall, Nottingham, NG8 6PE
Telephone 0115 9061301 ? Fax 0115 9061304 ? Email
jeni.tennison@xxxxxxxxxxxxxxxx



 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.