M
Michael
To all,
I am trying to query an XML document of the following structure.
<ROOT>
<A>
<B id="1"/>
<B id="2"/>
<B id="3"/>
</A>
<A>
<C id="1"/>
<C id="2"/>
<C id="5"/>
<C id="6"/>
</A>
</ROOT>
I want to select all <C> nodes that do not have a <B> element
associated (by id). In other words, what i am looking for is <C
id="5"/> and <C id="6"/>. I realize XPath was not designed to perform
such queries but is there any way to accomplish this?
What I have in mind is something like this:
//C[count(//B[@id = @id]) = 0]
The first "@id" is referencing the "id" attribute of the <B> element. I
want the second "@id" to reference the "id" attribute of the <C>
element. I can't think of any way to do this with axis since they only
allow me to choose nodes relative to the current node which is B.
Thanks,
Michael B.
I am trying to query an XML document of the following structure.
<ROOT>
<A>
<B id="1"/>
<B id="2"/>
<B id="3"/>
</A>
<A>
<C id="1"/>
<C id="2"/>
<C id="5"/>
<C id="6"/>
</A>
</ROOT>
I want to select all <C> nodes that do not have a <B> element
associated (by id). In other words, what i am looking for is <C
id="5"/> and <C id="6"/>. I realize XPath was not designed to perform
such queries but is there any way to accomplish this?
What I have in mind is something like this:
//C[count(//B[@id = @id]) = 0]
The first "@id" is referencing the "id" attribute of the <B> element. I
want the second "@id" to reference the "id" attribute of the <C>
element. I can't think of any way to do this with axis since they only
allow me to choose nodes relative to the current node which is B.
Thanks,
Michael B.