Alamelu
2006-11-11 12:25:01 UTC
I want to insert the contents in one XML to another.
Sample1.xml
<?xml version="1.0"?>
<Root xmlns:dt="urn:schemas-microsoft-com:datatypes" Version="1">
<VERSION dt:dt="string">Default</VERSION>
<NO dt:dt="string">Default</NO>
<SERIA dt:dt="string">Default</SERIAL>
<TIME dt:dt="dateTime">2006-10-30T16:57:32</TIME>
</Root>
I took the rootelement of Sample1.xml and tried to insert the contents to
another xml
I used AppendChild method
hRes = pNodeinSample2XML->raw_appendChild(pRootElementofSample1xml,
&pTempNode);
The problem with this approach was, it was including the root tag also...
(i.e) it was including
<Root xmlns:dt="urn:schemas-microsoft-com:datatypes" Version="1">
I want to insert the contents in sample1.xml without this Root Tag
I thought of getting the rootelement of sample1.xml, then loop through all
child nodes and copy each node to the target.
Are they any simple approach to do this without copying the Root Tag?
Regards,
Alamleu
Sample1.xml
<?xml version="1.0"?>
<Root xmlns:dt="urn:schemas-microsoft-com:datatypes" Version="1">
<VERSION dt:dt="string">Default</VERSION>
<NO dt:dt="string">Default</NO>
<SERIA dt:dt="string">Default</SERIAL>
<TIME dt:dt="dateTime">2006-10-30T16:57:32</TIME>
</Root>
I took the rootelement of Sample1.xml and tried to insert the contents to
another xml
I used AppendChild method
hRes = pNodeinSample2XML->raw_appendChild(pRootElementofSample1xml,
&pTempNode);
The problem with this approach was, it was including the root tag also...
(i.e) it was including
<Root xmlns:dt="urn:schemas-microsoft-com:datatypes" Version="1">
I want to insert the contents in sample1.xml without this Root Tag
I thought of getting the rootelement of sample1.xml, then loop through all
child nodes and copy each node to the target.
Are they any simple approach to do this without copying the Root Tag?
Regards,
Alamleu