Hi All,
Ive got a large XML set, which I would like to run some xpath on to make into a much smaller sub-set. Basically, I have this type of layout:
<root>
<item>
<collection1></collection1>
<collection2></collection2>
<collection3></collection3>
...
<collection55></collection55>
<name>item name</name>
<timestamp>47398743598</timestamp>
<another1></another1>
<another2></another2>
...
</item>
<item>
...
</item>
</root>
In other words, heaps of item nodes, and lots of other junk nodes that I dont care about.
I would like to run some xpath, to get that down to:
<root>
<item>
<name>item name</name>
<timestamp>47398743598</timestamp>
</item>
<item>
...
</item>
</root>
I have currently this type of thing:
//item/name
which only gets the name nodes,
so then Ive been trying this type of thing:
//item/name/parent::item
which gets the name nodes, and its parent (which is the item node) but also all of the sibling nodes of the name node, which is what Im trying to avoid!
Any help would be greatly appreciated
Cheers, Mark