|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: multi language support
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








