D
Duncan Smith
Suppose I have the following XML doc:
<root>
<tag id="1">
<number value="1"/>
</tag>
<tag id="2">
<something/>
</tag>
<tag id="3">
<something>
<number value="2"/>
<something/>
</tag>
</root>
I'm interested (a) 'tags that have a number element whose value
attribute > 0' and also (b) 'tags that have a something element that
have a number element whose value > 0'
I could run an x-path query for either (a) or (b), i.e. for (a):
'/root/tag[number/@value> 0]'
but what I really want is to somehow OR the two together so I end up
with:
<root>
<tag id="1">
<number value="1"/>
</tag>
<tag id="3">
<something>
<number value="2"/>
<something/>
</tag>
</root>
Can't seem to find the right syntax, any pointers?
Many thanks,
Duncan.
<root>
<tag id="1">
<number value="1"/>
</tag>
<tag id="2">
<something/>
</tag>
<tag id="3">
<something>
<number value="2"/>
<something/>
</tag>
</root>
I'm interested (a) 'tags that have a number element whose value
attribute > 0' and also (b) 'tags that have a something element that
have a number element whose value > 0'
I could run an x-path query for either (a) or (b), i.e. for (a):
'/root/tag[number/@value> 0]'
but what I really want is to somehow OR the two together so I end up
with:
<root>
<tag id="1">
<number value="1"/>
</tag>
<tag id="3">
<something>
<number value="2"/>
<something/>
</tag>
</root>
Can't seem to find the right syntax, any pointers?
Many thanks,
Duncan.