oracle.xml.parser.v2.XMLDOM Exception
Hi,
I am trying to get the control area (CNTROLAREA) from an incoming XML document and want to create a new XML document where the Control area from the incoming document will be part of the payload. Control area in incoming message is based on OAGIS standard.
Sample control area:
<CNTROLAREA>
<BSR>
<VERB value="PROCESS">PROCESS</VERB>
<NOUN value="PAYMENT">PAYMENT</NOUN>
<REVISION value="004"/>
</BSR>
<SENDER>
<LOGICALID/>
<COMPONENT>AP</COMPONENT>
<TASK>PROCESSPAYMENT</TASK>
<REFERENCEID>HM000A::</REFERENCEID>
<CONFIRMATION>2</CONFIRMATION>
<LANGUAGE>US</LANGUAGE>
<CODEPAGE>WE8ISO8859P1</CODEPAGE>
<AUTHID>APPS</AUTHID>
</SENDER>
<DATETIME qualifier="CREATION">
<YEAR>2002</YEAR>
<MONTH>06</MONTH>
<DAY>25</DAY>
<HOUR>08</HOUR>
<MINUTE>44</MINUTE>
<SECOND>58</SECOND>
<SUBSECOND>0000</SUBSECOND>
<TIMEZONE>+0000</TIMEZONE>
</DATETIME>
</CNTROLAREA>
I am getting the following error:
oracle.xml.parser.v2.XMLDOM Exception: NODE DOESN'T BELONG TO THE CURRENT DOCUMENT
Here is my java code:
nl=doc.getElementsByTagName("CNTROLAREA");
XMLElement orig_ctrl=(XMLElement)(nl.item(0)).cloneNode(true);
orig_ctrl.print(fout); /* prints out the incoming message control area */
confirm.appendChild(orig_ctrl); /*erroring here */
fout.println("after confirm msg");
from the log I can see that the reading of the control area works fine because it prints the control area correctly. But when I am trying to assign that to the payload of the new message, it errors out.
The code is designed so that it is not actually validating against DTD.
Please advise.
Your help is much appreciated
Thanks
Ragu