I don't know if i should post an xquery related question here ....
let's say my xml document is called abc.xml and looks like this:
<root>
<parent>
<childA>stuff</childA>
<childB>stuff</childB>
<childC>stuff</childC>
</parent>
<parent>
<childA>stuff 2</childA>
<childC>stuff 2</childC>
</parent>
<parent>
<childA>stuff 3</childA>
<childB>stuff 3</childB>
</parent>
</root>
I want to write an XQuery that would iterate through parents and will return parents for which childB tag exists or not.
how do i do this ?
it would start something like:
for $b in document("abc.xml")\root
where // <childB> does not exist - how do i check this
return <parent> ..... </parent>
let's say my xml document is called abc.xml and looks like this:
<root>
<parent>
<childA>stuff</childA>
<childB>stuff</childB>
<childC>stuff</childC>
</parent>
<parent>
<childA>stuff 2</childA>
<childC>stuff 2</childC>
</parent>
<parent>
<childA>stuff 3</childA>
<childB>stuff 3</childB>
</parent>
</root>
I want to write an XQuery that would iterate through parents and will return parents for which childB tag exists or not.
how do i do this ?
it would start something like:
for $b in document("abc.xml")\root
where // <childB> does not exist - how do i check this
return <parent> ..... </parent>