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

Re: Re: XPath to select node according to xml:lang at

Subject: Re: Re: XPath to select node according to xml:lang attribute
From: Philipp Kursawe <phil.kursawe@xxxxxxxxx>
Date: Fri, 15 Apr 2011 20:18:59 +0200
Re:  Re: XPath to select node according to xml:lang  at
> On 04/15/2011 01:53 PM, Philipp Kursawe wrote:
>> Well I do have a question to that still:
>>
>> <root>
>> <text id="color" xml:lang="en">colour</text>
>> <text id="color" xml:lang="en-us">color</text>
>> </root>
>>
>> using //text[@id='color' and (lang('en-us') or lang('en')]/text() will
>> always return "colour" although I am expecting "color". I know
>> attributes are not ordered, but can you not have the perfect match be
>> in the selected result first?
>
> These are filters, not ordered operations. B If you want an ordered
> selection, youbll need to be more explicit; in XSLT 1.0, that means
> using multiple variables instead of a single XPath.

Hmm I cannot use XSLT in my context. I can only use XPath. So I guess
I would have to select "en-us" first and see if there is a result, if
not select "en" and so on. Or could I "||" chain multiple XPath
selects?
//text[@id='color' and lang('en-us')] || //text[@id='color' and
lang('en')] || //text[@id='color']

Phil

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.