importNode in XML.Format serializer to prevent reports of adding the node to

the wrong DOM element. This fixes tests in Webkit-based browsers
and FF3, which enforces this constraint. r=tschaub (Closes #1219) 


git-svn-id: http://svn.openlayers.org/trunk/openlayers@5528 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2007-12-20 04:15:26 +00:00
parent 2e507b68b7
commit 3751402ff8

View File

@@ -114,6 +114,9 @@ OpenLayers.Format.XML = OpenLayers.Class(OpenLayers.Format, {
// Add nodes to a document before serializing. Everything else
// is serialized as is. This may need more work. See #1218 .
var doc = document.implementation.createDocument("", "", null);
if (doc.importNode) {
node = doc.importNode(node, true);
}
doc.appendChild(node);
data = serializer.serializeToString(doc);
} else {