From 5d8d936216a45cba022704ea74a046661bcc83b9 Mon Sep 17 00:00:00 2001 From: oterral Date: Thu, 26 Jun 2014 09:07:22 +0200 Subject: [PATCH] Use ol.xml.setAttributeNS for xmlns attributes --- src/ol/format/kmlformat.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/ol/format/kmlformat.js b/src/ol/format/kmlformat.js index 16b2a0d86b..e81556d23f 100644 --- a/src/ol/format/kmlformat.js +++ b/src/ol/format/kmlformat.js @@ -2527,12 +2527,13 @@ ol.format.KML.prototype.writeFeatures; * @inheritDoc */ ol.format.KML.prototype.writeFeaturesNode = function(features) { - var kml = ol.xml.createElementNS('http://www.opengis.net/kml/2.2', 'kml'); + var kml = ol.xml.createElementNS(ol.format.KML.NAMESPACE_URIS_[4], 'kml'); var xmlnsUri = 'http://www.w3.org/2000/xmlns/'; var xmlSchemaInstanceUri = 'http://www.w3.org/2001/XMLSchema-instance'; - kml.setAttributeNS(xmlnsUri, 'xmlns:gx', ol.format.KML.GX_NAMESPACE_URIS_[0]); - kml.setAttributeNS(xmlnsUri, 'xmlns:xsi', xmlSchemaInstanceUri); - kml.setAttributeNS(xmlSchemaInstanceUri, 'xsi:schemaLocation', + ol.xml.setAttributeNS(kml, xmlnsUri, 'xmlns:gx', + ol.format.KML.GX_NAMESPACE_URIS_[0]); + ol.xml.setAttributeNS(kml, xmlnsUri, 'xmlns:xsi', xmlSchemaInstanceUri); + ol.xml.setAttributeNS(kml, xmlSchemaInstanceUri, 'xsi:schemaLocation', ol.format.KML.XSD_URIS_.join(' ')); var /** @type {ol.xml.NodeStackItem} */ context = {node: kml};