Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Re: selecting a range of nodes [Thread Next] Re: selecting a range of nodesTo: NULL Date: 8/3/2007 2:05:00 PM Thanks to both for the replies Works a treat "Pavel Lepin" <p.lepin@c...> wrote in message news:f8uu90$m0f$1@a...... > > Andy Fish <ajfish@b...> wrote in > <joCsi.15392$7c.10352@f...>: >> <top> >> <a1/> >> <a2/> >> <foo/> >> <a3/> >> <a4/> >> <a5/> >> <a6/> >> <bar/> >> <a7/> >> <a8/> >> </top> >> >> now, inside this template >> >> <xsl:template match="foo"> >> >> I would like to select all the nodes up to the following >> <bar> (if there are several <bar>s it would be the next >> one) > > The need to do that often indicates a problem with the > design of your XML document. > >> it seems quite simple on the face of it but I can't figure >> out any way to get close at the moment > > Read up on generate-id() and current(): > > following-sibling::* > [ > generate-id(following-sibling::bar)= > generate-id(current()/following-sibling::bar) > ] > > Note that using keys may result in a significant performance > boost. > > -- > ...the pleasure of obedience is pretty thin compared with > the pleasure of hearing a rotten tomato hit someone in the > rear end. -- Garrison Keillor | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
