You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by jo...@apache.org on 2009/11/13 19:01:21 UTC

svn commit: r835942 - /xerces/c/trunk/src/xercesc/dom/impl/DOMDocumentImpl.cpp

Author: johns
Date: Fri Nov 13 18:01:21 2009
New Revision: 835942

URL: http://svn.apache.org/viewvc?rev=835942&view=rev
Log:
Fixed DOMDocumentImpl::importNode() to copy the prefix of element and attribute nodes.

Modified:
    xerces/c/trunk/src/xercesc/dom/impl/DOMDocumentImpl.cpp

Modified: xerces/c/trunk/src/xercesc/dom/impl/DOMDocumentImpl.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/dom/impl/DOMDocumentImpl.cpp?rev=835942&r1=835941&r2=835942&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/impl/DOMDocumentImpl.cpp (original)
+++ xerces/c/trunk/src/xercesc/dom/impl/DOMDocumentImpl.cpp Fri Nov 13 18:01:21 2009
@@ -1067,6 +1067,9 @@
             else
             {
                 DOMElementNSImpl* nsElem = (DOMElementNSImpl*)createElementNS(source->getNamespaceURI(), source->getNodeName());
+                if(source->getNamespaceURI() != 0 && *source->getNamespaceURI() != 0) {
+                    nsElem->setPrefix(source->getPrefix());
+                }
                 DOMTypeInfoImpl* clonedTypeInfo=NULL;
                 // if the source has type informations, copy them
                 DOMPSVITypeInfo* sourcePSVI=(DOMPSVITypeInfo*)source->getFeature(XMLUni::fgXercescInterfacePSVITypeInfo, 0);
@@ -1113,8 +1116,12 @@
             DOMAttrImpl* newattr=NULL;
             if (source->getLocalName() == 0)
                 newattr = (DOMAttrImpl*)createAttribute(source->getNodeName());
-            else
+            else {
                 newattr = (DOMAttrImpl*)createAttributeNS(source->getNamespaceURI(), source->getNodeName());
+                if(source->getNamespaceURI() != 0 && *source->getNamespaceURI() != 0) {
+                    newattr->setPrefix(source->getPrefix());
+                }
+            }
             DOMTypeInfoImpl* clonedTypeInfo=NULL;
             // if the source has type informations, copy them
             DOMPSVITypeInfo* sourcePSVI=(DOMPSVITypeInfo*)source->getFeature(XMLUni::fgXercescInterfacePSVITypeInfo, 0);



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org