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

Re: xpath expression needed

Subject: Re: xpath expression needed
From: Jörg Heinicke <joerg.heinicke@xxxxxx>
Date: Thu, 20 Sep 2001 21:31:37 +0200
Re:  xpath expression needed
Matching on the root-node:

<xsl:template match="root">
    <xsl:apply-templates
select="level1/field1[following-sibling::field2[1]='some']">
</xsl:template>


Joerg


> Hi List,
>
> I have a XML as follows
>
> <level1 name = 'a'>
>      <field1>value1</field1>
>      <field2>some</field2>
>      <field3>value3</field3>
> </level1>
> <level1 name='b'>
>      <field1>value1</field1>
>      <field2>some</field2>
>      <field3>value3</field3>
> </level1>
> <level1 name='c'>
>      <field1>value1</field1>
>      <field2>someother</field2>
>      <field3>value3</field3>
> </level1>
>
> I want to get all the occurrences of "field1" whose first
following-sibling
> "field2" has a value = "some". In this case it should return me 2nodes
> (except the last one, where the value would be "someother")
>
> Hope I am clear.
>
> Thanks,
> Sanjay


 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.