I am really not sure if i
would sound stupid with the problem I am seeking help for. But still
optimistic about recieving an answer I am sending this mail.
I have this requirement of filtering out some sub-nodes from a XML
based on the values of attribute inside the sub-node. For eg
Input XML:
---------
<rootnode>
<mynode>
<myvalue>1</myvalue>
</mynode>
<mynode>
<myvalue>1</myvalue>
</mynode>
<mynode>
<myvalue>2</myvalue>
</mynode>
<mynode>
<myvalue>2</myvalue>
</mynode>
<mynode>
<myvalue>1</myvalue>
</mynode>
</rootnode>
Processing:
----------
Filter out all nodes which have myvalue=2
Output XML:
----------
<rootnode>
<mynode>
<myvalue>1</myvalue>
</mynode>
<mynode>
<myvalue>1</myvalue>
</mynode>
<mynode>
<myvalue>1</myvalue>
</mynode>
</rootnode>
Can anyone please suggest me the best way to do it ? I am a beginner
with DOM parsing. If you can please point me to available
documentation/ code snippents, that would be great.