Altova Mailing List Archives
>comp.text.xml Archive Home
>Thread Prev - XPath expression that gets a node with 2 particular children
>Thread Next - Re: XPath expression that gets a node with 2 particular children
Re: XPath expression that gets a node with 2 particular children
Date: 7/5/2003 8:01:00 PM
> AAA > BBB > CCC > DDD > /BBB > /AAA This is not xml at all, probably you meant: <AAA> <BBB> <CCC/> <DDD/> </BBB> </AAA> Use: /AAA/BBB[CCC and DDD and not(*)] ===== Cheers, Dimitre Novatchev. http://fxsl.sourceforge.net/ -- the home of FXSL "Jeff" <LNMEgo@h...> wrote in message news:ce9e21d9.0307050839.35b7df3a@p...... > I'd like to write an XPath expression that gets a node with 2 > particular children. > > I thought this would work: > /AAA/BBB/CCC/following-silbing::DDD/parent::node() > > on xml like this: > > AAA > BBB > CCC > DDD > /BBB > /AAA > > But it doesn;t seem to. I've been testing it here: > http://www.zvon.org:9001/saxon/cgi-bin/XLab/XML/source1.html > I would like to have some sort of "/sibling::DDD" so that I can find > any sib not just following or preceeding, but I can't seem to find a > way to do that either. > > Any ideas? > > BTW, My next step is to also require the that a particular attribute > of one of the children has one of a set of values. > > Thanks.