Altova Mailing List Archives
>comp.text.xml Archive Home
>Recent entries
>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
To: NULL
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(*[3])]
=====
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.
Disclaimer
These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

