This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: xpath expression needed
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: Re: [xsl] xpath expression needed
- From: Jörg Heinicke <joerg dot heinicke at gmx dot de>
- Date: Thu, 20 Sep 2001 21:31:37 +0200
- References: <OFEF9F7A64.8E4F95AB-ON85256ACD.00689B9D@towers.com>
- Reply-To: xsl-list at lists dot mulberrytech dot com
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