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

Re: Select a node only if its previous siblings have

Subject: Re: Select a node only if its previous siblings have specific attributes
From: Philipp Kursawe <phil.kursawe@xxxxxxxxx>
Date: Sat, 16 Apr 2011 20:37:58 +0200
Re:  Select a node only if its previous siblings have
Works like a charme Brandon! Thanks!

On Fri, Apr 15, 2011 at 8:44 PM, Brandon Ibach
<brandon.ibach@xxxxxxxxxxxxxxxxxxx> wrote:
> I'm not sure I'm completely clear on your requirement, but try this:
>
> //data[@result = '9'][not(preceding-sibling::data[@result != '10' and
> @result != '11'])][last()]
>
> -Brandon :)
>
>
> On Fri, Apr 15, 2011 at 1:40 PM, Philipp Kursawe <phil.kursawe@xxxxxxxxx>
wrote:
>> Hello,
>>
>> a node with @result='9' should be select if one of its previous
>> siblings has @result=10 or @result=11. Only the most recent node with
>> @result=9 should be selected.
>>
>> given the following examples:
>>
>> <root>
>> <data result="11"/>
>> <data result="10"/>
>> <data result="9"/>
>> </root>
>> Should select data[3]
>>
>> <root>
>> <data result="11"/>
>> <data result="5"/>
>> <data result="9"/>
>> </root>
>> Should not select any node, because one of data[3] prev siblings has
>> @result != 10|11
>>
>> <root>
>> <data result="11"/>
>> <data result="9"/>
>> <data result="5"/>
>> <data result="9"/>
>> </root>
>> Should select data[2] not data[4] because data[4] has previous
>> siblings with @result != 10|11
>>
>> How would the XPath selector look like? Basically i need to find the
>> first() (or last()?) node whose previous siblings do not have
>> @result=10|11
>>
>> Thanks for your help!
>> 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.