Subject: RE: [xsl] xpath expression needed From: "Corey Spitzer" <cspitzer@xxxxxxxxx> Date: Thu, 20 Sep 2001 14:58:51 -0500 |
<xsl:template match="//field1[following-sibling::field2='some']"> -----Original Message----- From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Jörg Heinicke Sent: Thursday, September 20, 2001 2:32 PM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: Re: [xsl] 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 XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] xpath expression needed, Jörg Heinicke | Thread | RE: [xsl] xpath expression needed, Michael Kay |
[xsl] one XML file, two XSLT style , Ines Robbers | Date | Re: [xsl] one XML file, two XSLT st, Jörg Heinicke |
Month |