Hi everyone,
I am quite new to XML/DOM, but not so new to
java. I have a situation, where the input xml
string is being read as a Document and I would like to remove some data(described below) and update the Document with the modified data. Finally the document is converted back to xml string from the Document.
FYI, JDK1.2.2, Xerces parser.
Here is the xml string :
Case1:
<xml....1.0...?>
<fault errCd="1234" errMsg="some msg" errType="E" />
With the above xml string as input, no problem, code works just fine.
Now, consider this xml string:
Case2:
<xml....1.0...?>
<fault errCd="1234" errMsg="some msg" errType="E"
<NVPair name="somename" value="somevalue" />
/>
When the above xml string appears, the code does not work, since it is NOT expecting NVPair, which is a SEQUENCE in the XML structure. Hence I want to delete this sequence (NVpair), so that the xml appears exactly as in case 1 described above.
Any ideas/help will be appreciated.
Thanks in advance.