HI,
I am using VC++ 6.0 and MSXML 4.0. I am trying to copy the node matching a
XPATH from one DOMDocument to an other document.
CXMLDOMNodeList itemList = xmlDOMSrc.SelectNodes(sXPath);
for (int i=0; i< itemList.GetLength(); i++) {
itemNode = itemList.NextNode();
if(itemNode){
newNode = itemNode.CloneNode(1);
xmlDOMDst.AppendChild(newNode);
}
}
The problem is that none of the child node of itemNode is cloned.
Any one has an idea why CloneNode is not working properly?
Thank you
itemNode XML sample:
<ITEM Code="WORCHESTERSHIRE" SupplierCode="" Description="WOSCHESTERSHIRE"
Completed="1">
<PRICE>1397</PRICE>
<ORDERED_QTY>31000</ORDERED_QTY>
<DELIVERY_QTY>14127</DELIVERY_QTY>
<DELIVERY_DATE>2002-08-13</DELIVERY_DATE>
<PURCHASE_FORMAT Id="6" Description="CASE"/>
<UNDELIVERY_REASON Id="0" Description=""/>
<TOTAL>43307</TOTAL><LAST_COST>0</LAST_COST><LAST_SUPPLIER
Code="" Name=""/></ITEM>
newNode XML sample:
<ITEM Code="WORCHESTERSHIRE" SupplierCode="" Description="WOSCHESTERSHIRE"
Completed="1">
</ITEM>"
I am using VC++ 6.0 and MSXML 4.0. I am trying to copy the node matching a
XPATH from one DOMDocument to an other document.
CXMLDOMNodeList itemList = xmlDOMSrc.SelectNodes(sXPath);
for (int i=0; i< itemList.GetLength(); i++) {
itemNode = itemList.NextNode();
if(itemNode){
newNode = itemNode.CloneNode(1);
xmlDOMDst.AppendChild(newNode);
}
}
The problem is that none of the child node of itemNode is cloned.
Any one has an idea why CloneNode is not working properly?
Thank you
itemNode XML sample:
<ITEM Code="WORCHESTERSHIRE" SupplierCode="" Description="WOSCHESTERSHIRE"
Completed="1">
<PRICE>1397</PRICE>
<ORDERED_QTY>31000</ORDERED_QTY>
<DELIVERY_QTY>14127</DELIVERY_QTY>
<DELIVERY_DATE>2002-08-13</DELIVERY_DATE>
<PURCHASE_FORMAT Id="6" Description="CASE"/>
<UNDELIVERY_REASON Id="0" Description=""/>
<TOTAL>43307</TOTAL><LAST_COST>0</LAST_COST><LAST_SUPPLIER
Code="" Name=""/></ITEM>
newNode XML sample:
<ITEM Code="WORCHESTERSHIRE" SupplierCode="" Description="WOSCHESTERSHIRE"
Completed="1">
</ITEM>"