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

Re: Evaluatable XPath. ( XPath extensions ).

Subject: Re: Evaluatable XPath. ( XPath extensions ).
From: Tony Graham <tgraham@xxxxxxxxxxxxxxxx>
Date: Thu, 18 May 2000 14:09:53 -0400 (EST)
xpath xml lang
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@xxxxxxxxxxxxxxxx
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


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.