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

Re: XPath to select based on attr = same attr of an a

Subject: Re: XPath to select based on attr = same attr of an ancestor
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Sun, 13 Jul 2008 23:05:04 -0400
Re:  XPath to select based on attr = same attr of an  a
Sorry, Syd, I didn't complete my thought in enough detail.

At 2008-07-13 22:56 -0400, I wrote:
I've also included a solution that uses xml:lang= instead of lang= since there are more semantics for xml:lang= ... for example, in the third test the xml:lang= of the document is a subset of the xml:lang= of the embedded content. I don't know if this will be of help or not (in fact, it might be backwards from what you need and not of any use).

XSLT has the lang(arg) function that returns true() if the inherited xml:lang= language of the current node is a *case-insensitive subset* of the language specified in the argument. So, in my example data in test 3 the xml:lang="FR-CA" matches xml:lang="fr". I'm passing the closest ancestral language attribute to the function that acts on the language of the current node:


match="foreign[lang(ancestor::*[@xml:lang][1]/@xml:lang)]"

... which will be true if there is no xml:lang= on the element, or the tested value if there is an xml:lang= on the element.

I hope this helps.

. . . . . . . . . Ken

--
Upcoming XSLT/XSL-FO hands-on courses:      Wellington, NZ 2009-01
World-wide corporate, govt. & user group XML, XSL and UBL training
RSS feeds:     publicly-available developer resources and training
G. Ken Holman                 mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal

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.