Fix XML serialize and xml_eql in IE9

Use the xml property instead in IE for serializing XML.
The xml_eql tests were failing in IE9 on a difference between null and an
empty string for namespaceURI of attributes, this difference is not
relevant to our testing so make sure we ignore.
This commit is contained in:
Bart van den Eijnden
2013-05-24 10:53:29 +02:00
parent f8ef902af4
commit d8232bb484
2 changed files with 15 additions and 2 deletions

View File

@@ -256,7 +256,9 @@ ol.parser.XML.prototype.setAttributeNS = function(node, uri, name, value) {
* @return {string} The serialized XML string.
*/
ol.parser.XML.prototype.serialize = function(node) {
if (node.nodeType == 1) {
if (this.xmldom) {
return node.xml;
} else if (node.nodeType == 1) {
// Add nodes to a document before serializing. Everything else
// is serialized as is. This is also needed to get all namespaces
// defined in some browsers such as Chrome (xmlns attributes).