This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Evaluatable XPath. ( XPath extensions ).
- To: xsl-list at mulberrytech dot com
- Subject: Re: Evaluatable XPath. ( XPath extensions ).
- From: Tony Graham <tgraham at mulberrytech dot com>
- Date: Thu, 18 May 2000 14:09:53 -0400 (EST)
- References: <20000518145905.28210.qmail@web4101.mail.yahoo.com>
- Reply-To: xsl-list at mulberrytech dot com
At 18 May 2000 16:59 +0200, Sydney wrote:
> Why not writing this like that
>
> <cfg>
> <text xml:lang="ENG">English text</text>
xml:lang attributes should only use language identifiers in the format
defined by RFC 1766, which means two-character language codes from ISO
639 among other things. "EN" or "en" (or "En" or "eN") is correct,
"ENG" is not.
> <text xml:lang="RU">Russian text</text>
> </cfg>
>
> <xsl:template match="cfg/text[@xml:lang = $lang]>
> </xsl:template>
There's also the lang() function that returns true or false for a
match on the current xml:lang value, which could be set by a
containing element. lang() matches case-insensitively and ignores
country subtags when determining a match. For example, lang('en')
returns true when the current xml:lang value is "EN", "en", or even
my preferred form: 'en-AU'.
Regards,
Tony Graham
======================================================================
Tony Graham mailto:tgraham@mulberrytech.com
Mulberry Technologies, Inc. http://www.mulberrytech.com
17 West Jefferson Street Direct Phone: 301/315-9632
Suite 207 Phone: 301/315-9631
Rockville, MD 20850 Fax: 301/315-8285
----------------------------------------------------------------------
Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list