From 2259db22255fc5a747182fa7f1d594198ca9ff13 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Fri, 1 Feb 2008 21:44:43 +0000 Subject: [PATCH] Correcting typo in the OSM format and adding support for null namespaceURI in IE. r=crschmidt (closes #1318) git-svn-id: http://svn.openlayers.org/trunk/openlayers@5965 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Format/OSM.js | 2 +- lib/OpenLayers/Format/XML.js | 6 +++++- tests/data/osm.js | 21 +++++++++++---------- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/lib/OpenLayers/Format/OSM.js b/lib/OpenLayers/Format/OSM.js index f70869097c..35eadf13b3 100644 --- a/lib/OpenLayers/Format/OSM.js +++ b/lib/OpenLayers/Format/OSM.js @@ -290,7 +290,7 @@ OpenLayers.Format.OSM = OpenLayers.Class(OpenLayers.Format.XML, { this.osm_id = 1; this.created_nodes = {}; - var root_node = document.createElementNS(null, "osm"); + var root_node = this.createElementNS(null, "osm"); root_node.setAttribute("version", "0.5"); root_node.setAttribute("generator", "OpenLayers "+ OpenLayers.VERSION_NUMBER); diff --git a/lib/OpenLayers/Format/XML.js b/lib/OpenLayers/Format/XML.js index 44cc5d26d9..0552844da5 100644 --- a/lib/OpenLayers/Format/XML.js +++ b/lib/OpenLayers/Format/XML.js @@ -145,7 +145,11 @@ OpenLayers.Format.XML = OpenLayers.Class(OpenLayers.Format, { createElementNS: function(uri, name) { var element; if(this.xmldom) { - element = this.xmldom.createNode(1, name, uri); + if(typeof uri == "string") { + element = this.xmldom.createNode(1, name, uri); + } else { + element = this.xmldom.createNode(1, name, ""); + } } else { element = document.createElementNS(uri, name); } diff --git a/tests/data/osm.js b/tests/data/osm.js index 966b06aedf..6c94459437 100644 --- a/tests/data/osm.js +++ b/tests/data/osm.js @@ -1,13 +1,14 @@ - var osm_test_data = { - 'node': ' ', - 'node_with_tags': ' ', - 'way': ' ', - 'node_way': ' ' } +var osm_test_data = { + 'node': ' ', + 'node_with_tags': ' ', + 'way': ' ', + 'node_way': ' ' +}; var osm_serialized_data = { - 'node':'', - 'node_with_tags':'', - 'way':'', - 'node_way':'' -} + 'node':'', + 'node_with_tags':'', + 'way':'', + 'node_way':'' +};