Hi,

I used the following code to import a node (along with child nodes) from a
document to another

    DOMElement* tempNode =
(DOMElement*)doc->importNode(messageHandler->currentNode, true);
    currentNode = currentNode->appendChild(tempNode);

(currentNode is DOMNode*).

But when I saw the result, the namespace definitions also are appearing in
the node and its child nodes.  these definitions are already there in the
root node of destination document.

source node to be imported
----------------------------------------
  <jobBody>
    <requestType>activateConnection</requestType>
    <jobType>provide</jobType>
    <connectionType>BB IPStream</connectionType>
    <pSIService>
      <S97:serviceId>VLAN BB MJ AGG</S97:serviceId>
      <S97:serviceName>TestVLAN_BB</S97:serviceName>
      <S97:serviceDescription>00034</S97:serviceDescription>
    </pSIService>

after import, the node in the destination document look like this:
---------------------------------------------------------------------------------------------
  <jobBody xmlns="
http://itprogrammes.intra.xxx.com/pdb/capabilities/ManageDaaliResource/2005/11/16
">
    <requestType>activateConnection</requestType>
    <jobType>provide</jobType>
    <connectionType>BB IPStream</connectionType>
    <pSIService>
      <S97:serviceId xmlns:S97="
http://ccm.intra.xxx.com/2005/11/16/LIB/Info/CCM/AnalysisModel/Services";>VLAN<http://ccm.intra.xxx.com/2005/11/16/LIB/Info/CCM/AnalysisModel/Services%22%3EVLAN>BB
MJ AGG</S97:serviceId>
      <S97:serviceName
xmlns:S97="http://ccm.intra.xxx.com/2005/11/16/LIB/Info/CCM/AnalysisModel/Services";>TestVLAN_BB</S97:serviceName
<http://ccm.intra.xxx.com/2005/11/16/LIB/Info/CCM/AnalysisModel/Services%22%3ETestVLAN_BB%3C/S97:serviceName>
>
      <S97:serviceDescription
xmlns:S97="http://ccm.intra.xxx.com/2005/11/16/LIB/Info/CCM/AnalysisModel/Services";>00034</S97:serviceDescription
<http://ccm.intra.xxx.com/2005/11/16/LIB/Info/CCM/AnalysisModel/Services%22%3E00034%3C/S97:serviceDescription>
>
    </pSIService>

How can I suppress these namespace definitions so that I get the desired
output?  Appreciate if anybody can give a quick info.

Thanks and Regards
Mini.

Reply via email to