Has anyone used the 'importNode' and the 'replaceChild' methods
of Interface Document and Node or adding 2 XML documents ?
I need to add 2 XML documents in Java.
My Java code is trying to use this
Please,has anyone used the above methods?
How can I add both the XML docs?
Help really appreciated
of Interface Document and Node or adding 2 XML documents ?
I need to add 2 XML documents in Java.
Code:
DocumentOne ----------- <?xml version="1.0" encoding="UTF-8"?> <i:Interest xmlns:i="http://www.ABC.com/interests:i"> <i:ID>0</i:ID><i:Generation/> <i:Delta/><i:Ref/> </i:Interest> DocumentTwo ----------- <i:Underlying xmlns:i="common" xmlns:common="http://www.ABC.com/common" value="KGF"> <common:Code>KGF</common:Code> <common:Class>STOCK</common:Class> </i:Underlying> Output Format ------------- <?xml version="1.0" encoding="UTF-8"?> <i:Interest xmlns:i="http://www.ABC.com/interests:i"> <i:ID>0</i:ID><i:Generation/> <i:Delta/><i:Ref/> <i:Underlying xmlns:i="common" xmlns:common="http://www.ABC.com/common" value="KGF"> <common:Code>KGF</common:Code> <common:Class>STOCK</common:Class> </i:Underlying> </i:Interest>
Code:
DocumentOne.importNode(DocumentTwo,true) DocumentOne.replaceChild...
Please,has anyone used the above methods?
How can I add both the XML docs?
Help really appreciated
Comment