From 88d1258e83c2ae1cd77613b5b1c0796710fcfc48 Mon Sep 17 00:00:00 2001 From: Antoine Abt Date: Mon, 27 Oct 2014 11:00:09 +0100 Subject: [PATCH] Rename ol.xml.load to ol.xml.parse --- src/ol/format/kmlformat.js | 2 +- src/ol/format/wfsformat.js | 4 +- src/ol/format/xmlfeatureformat.js | 8 ++-- src/ol/format/xmlformat.js | 2 +- src/ol/source/formatvectorsource.js | 2 +- src/ol/xml.js | 3 +- test/spec/ol/format/gmlformat.test.js | 40 ++++++++--------- test/spec/ol/format/gpxformat.test.js | 28 ++++++------ test/spec/ol/format/kmlformat.test.js | 62 +++++++++++++-------------- test/spec/ol/format/owsformat.test.js | 6 +-- test/spec/ol/format/wfsformat.test.js | 18 ++++---- 11 files changed, 88 insertions(+), 87 deletions(-) diff --git a/src/ol/format/kmlformat.js b/src/ol/format/kmlformat.js index 85d28a228e..dc6d457d89 100644 --- a/src/ol/format/kmlformat.js +++ b/src/ol/format/kmlformat.js @@ -1655,7 +1655,7 @@ ol.format.KML.prototype.readName = function(source) { } else if (ol.xml.isNode(source)) { return this.readNameFromNode(/** @type {Node} */ (source)); } else if (goog.isString(source)) { - var doc = ol.xml.load(source); + var doc = ol.xml.parse(source); return this.readNameFromDocument(doc); } else { goog.asserts.fail(); diff --git a/src/ol/format/wfsformat.js b/src/ol/format/wfsformat.js index 055efdf447..ea9ab4a6b5 100644 --- a/src/ol/format/wfsformat.js +++ b/src/ol/format/wfsformat.js @@ -149,7 +149,7 @@ ol.format.WFS.prototype.readTransactionResponse = function(source) { } else if (ol.xml.isNode(source)) { return this.readTransactionResponseFromNode(/** @type {Node} */ (source)); } else if (goog.isString(source)) { - var doc = ol.xml.load(source); + var doc = ol.xml.parse(source); return this.readTransactionResponseFromDocument(doc); } else { goog.asserts.fail(); @@ -172,7 +172,7 @@ ol.format.WFS.prototype.readFeatureCollectionMetadata = function(source) { return this.readFeatureCollectionMetadataFromNode( /** @type {Node} */ (source)); } else if (goog.isString(source)) { - var doc = ol.xml.load(source); + var doc = ol.xml.parse(source); return this.readFeatureCollectionMetadataFromDocument(doc); } else { goog.asserts.fail(); diff --git a/src/ol/format/xmlfeatureformat.js b/src/ol/format/xmlfeatureformat.js index 3c61ee6574..7dea0579b5 100644 --- a/src/ol/format/xmlfeatureformat.js +++ b/src/ol/format/xmlfeatureformat.js @@ -43,7 +43,7 @@ ol.format.XMLFeature.prototype.readFeature = function(source, opt_options) { } else if (ol.xml.isNode(source)) { return this.readFeatureFromNode(/** @type {Node} */ (source), opt_options); } else if (goog.isString(source)) { - var doc = ol.xml.load(source); + var doc = ol.xml.parse(source); return this.readFeatureFromDocument(doc, opt_options); } else { goog.asserts.fail(); @@ -86,7 +86,7 @@ ol.format.XMLFeature.prototype.readFeatures = function(source, opt_options) { } else if (ol.xml.isNode(source)) { return this.readFeaturesFromNode(/** @type {Node} */ (source), opt_options); } else if (goog.isString(source)) { - var doc = ol.xml.load(source); + var doc = ol.xml.parse(source); return this.readFeaturesFromDocument(doc, opt_options); } else { goog.asserts.fail(); @@ -134,7 +134,7 @@ ol.format.XMLFeature.prototype.readGeometry = function(source, opt_options) { } else if (ol.xml.isNode(source)) { return this.readGeometryFromNode(/** @type {Node} */ (source), opt_options); } else if (goog.isString(source)) { - var doc = ol.xml.load(source); + var doc = ol.xml.parse(source); return this.readGeometryFromDocument(doc, opt_options); } else { goog.asserts.fail(); @@ -170,7 +170,7 @@ ol.format.XMLFeature.prototype.readProjection = function(source) { } else if (ol.xml.isNode(source)) { return this.readProjectionFromNode(/** @type {Node} */ (source)); } else if (goog.isString(source)) { - var doc = ol.xml.load(source); + var doc = ol.xml.parse(source); return this.readProjectionFromDocument(doc); } else { goog.asserts.fail(); diff --git a/src/ol/format/xmlformat.js b/src/ol/format/xmlformat.js index 111bf5f511..11d46fbe6a 100644 --- a/src/ol/format/xmlformat.js +++ b/src/ol/format/xmlformat.js @@ -25,7 +25,7 @@ ol.format.XML.prototype.read = function(source) { } else if (ol.xml.isNode(source)) { return this.readFromNode(/** @type {Node} */ (source)); } else if (goog.isString(source)) { - var doc = ol.xml.load(source); + var doc = ol.xml.parse(source); return this.readFromDocument(doc); } else { goog.asserts.fail(); diff --git a/src/ol/source/formatvectorsource.js b/src/ol/source/formatvectorsource.js index 81b0dd7e9b..1ceba4d297 100644 --- a/src/ol/source/formatvectorsource.js +++ b/src/ol/source/formatvectorsource.js @@ -91,7 +91,7 @@ ol.source.FormatVector.prototype.loadFeaturesFromURL = source = xhrIo.getResponseXml(); } if (!goog.isDefAndNotNull(source)) { - source = ol.xml.load(xhrIo.getResponseText()); + source = ol.xml.parse(xhrIo.getResponseText()); } } else { goog.asserts.fail(); diff --git a/src/ol/xml.js b/src/ol/xml.js index d4844472ae..249713fca2 100644 --- a/src/ol/xml.js +++ b/src/ol/xml.js @@ -333,11 +333,12 @@ ol.xml.setAttributeNS = /** + * Parse an XML string to a XML Document * @param {string} xml XML. * @return {Document} Document. * @api */ -ol.xml.load = function(xml) { +ol.xml.parse = function(xml) { return new DOMParser().parseFromString(xml, 'application/xml'); }; diff --git a/test/spec/ol/format/gmlformat.test.js b/test/spec/ol/format/gmlformat.test.js index 668f1aa9ea..3aeece75f5 100644 --- a/test/spec/ol/format/gmlformat.test.js +++ b/test/spec/ol/format/gmlformat.test.js @@ -1,7 +1,7 @@ goog.provide('ol.test.format.GML'); var readGeometry = function(format, text, opt_options) { - var doc = ol.xml.load(text); + var doc = ol.xml.parse(text); // we need an intermediate node for testing purposes var node = goog.dom.createElement(goog.dom.TagName.PRE); node.appendChild(doc.documentElement); @@ -131,7 +131,7 @@ describe('ol.format.GML3', function() { expect(g).to.be.an(ol.geom.Point); expect(g.getCoordinates()).to.eql([1, 2, 0]); var serialized = format.writeGeometry(g); - expect(serialized.firstElementChild).to.xmleql(ol.xml.load(text)); + expect(serialized.firstElementChild).to.xmleql(ol.xml.parse(text)); }); it('can read a point geometry with scientific notation', function() { @@ -201,7 +201,7 @@ describe('ol.format.GML3', function() { expect(g).to.be.an(ol.geom.Point); expect(g.getCoordinates()).to.eql([1, 2, 0]); var serialized = formatWGS84.writeGeometry(g); - expect(serialized.firstElementChild).to.xmleql(ol.xml.load(text)); + expect(serialized.firstElementChild).to.xmleql(ol.xml.parse(text)); }); }); @@ -218,7 +218,7 @@ describe('ol.format.GML3', function() { expect(g).to.be.an(ol.geom.LineString); expect(g.getCoordinates()).to.eql([[1, 2, 0], [3, 4, 0]]); var serialized = format.writeGeometry(g); - expect(serialized.firstElementChild).to.xmleql(ol.xml.load(text)); + expect(serialized.firstElementChild).to.xmleql(ol.xml.parse(text)); }); it('can read, transform and write a linestring geometry', function() { @@ -257,7 +257,7 @@ describe('ol.format.GML3', function() { expect(g).to.be.an(ol.geom.LineString); expect(g.getCoordinates()).to.eql([[1, 2, 0], [3, 4, 0]]); var serialized = formatWGS84.writeGeometry(g); - expect(serialized.firstElementChild).to.xmleql(ol.xml.load(text)); + expect(serialized.firstElementChild).to.xmleql(ol.xml.parse(text)); }); }); @@ -275,7 +275,7 @@ describe('ol.format.GML3', function() { expect(g).to.be.an(ol.geom.LineString); expect(g.getCoordinates()).to.eql([[-180, -90, 0], [180, 90, 0]]); var serialized = formatWGS84.writeGeometry(g); - expect(serialized.firstElementChild).to.xmleql(ol.xml.load(text)); + expect(serialized.firstElementChild).to.xmleql(ol.xml.parse(text)); }); it('can read and write a point geometry with correct axis order', @@ -289,7 +289,7 @@ describe('ol.format.GML3', function() { expect(g).to.be.an(ol.geom.Point); expect(g.getCoordinates()).to.eql([-180, -90, 0]); var serialized = formatWGS84.writeGeometry(g); - expect(serialized.firstElementChild).to.xmleql(ol.xml.load(text)); + expect(serialized.firstElementChild).to.xmleql(ol.xml.parse(text)); }); it('can read and write a surface geometry with right axis order', @@ -320,7 +320,7 @@ describe('ol.format.GML3', function() { srsName: 'urn:x-ogc:def:crs:EPSG:4326', surface: false}); var serialized = format.writeGeometry(g); - expect(serialized.firstElementChild).to.xmleql(ol.xml.load(text)); + expect(serialized.firstElementChild).to.xmleql(ol.xml.parse(text)); }); }); @@ -353,7 +353,7 @@ describe('ol.format.GML3', function() { expect(g.getCoordinates()).to.eql( [[1, 2, 0], [3, 4, 0], [5, 6, 0], [1, 2, 0]]); var serialized = format.writeGeometry(g); - expect(serialized.firstElementChild).to.xmleql(ol.xml.load(text)); + expect(serialized.firstElementChild).to.xmleql(ol.xml.parse(text)); }); }); @@ -386,7 +386,7 @@ describe('ol.format.GML3', function() { [1, 2, 0]], [[2, 3, 0], [2, 5, 0], [4, 5, 0], [2, 3, 0]], [[3, 4, 0], [3, 6, 0], [5, 6, 0], [3, 4, 0]]]); var serialized = format.writeGeometry(g); - expect(serialized.firstElementChild).to.xmleql(ol.xml.load(text)); + expect(serialized.firstElementChild).to.xmleql(ol.xml.parse(text)); }); }); @@ -424,7 +424,7 @@ describe('ol.format.GML3', function() { [[3, 4, 0], [3, 6, 0], [5, 6, 0], [3, 4, 0]]]); format = new ol.format.GML({srsName: 'CRS:84', surface: true}); var serialized = format.writeGeometry(g); - expect(serialized.firstElementChild).to.xmleql(ol.xml.load(text)); + expect(serialized.firstElementChild).to.xmleql(ol.xml.parse(text)); }); }); @@ -446,7 +446,7 @@ describe('ol.format.GML3', function() { expect(g.getCoordinates()).to.eql([[1, 2, 0], [3, 4, 0]]); format = new ol.format.GML({srsName: 'CRS:84', curve: true}); var serialized = format.writeGeometry(g); - expect(serialized.firstElementChild).to.xmleql(ol.xml.load(text)); + expect(serialized.firstElementChild).to.xmleql(ol.xml.parse(text)); }); }); @@ -492,7 +492,7 @@ describe('ol.format.GML3', function() { expect(g).to.be.an(ol.geom.MultiPoint); expect(g.getCoordinates()).to.eql([[1, 2, 0], [2, 3, 0], [3, 4, 0]]); var serialized = format.writeGeometry(g); - expect(serialized.firstElementChild).to.xmleql(ol.xml.load(text)); + expect(serialized.firstElementChild).to.xmleql(ol.xml.parse(text)); }); it('can read a plural multipoint geometry', function() { @@ -541,7 +541,7 @@ describe('ol.format.GML3', function() { [[[1, 2, 0], [2, 3, 0]], [[3, 4, 0], [4, 5, 0]]]); format = new ol.format.GML({srsName: 'CRS:84', multiCurve: false}); var serialized = format.writeGeometry(g); - expect(serialized.firstElementChild).to.xmleql(ol.xml.load(text)); + expect(serialized.firstElementChild).to.xmleql(ol.xml.parse(text)); }); it('can read a plural multilinestring geometry', function() { @@ -609,7 +609,7 @@ describe('ol.format.GML3', function() { [[[1, 2, 0], [3, 2, 0], [3, 4, 0], [1, 2, 0]]]]); format = new ol.format.GML({srsName: 'CRS:84', multiSurface: false}); var serialized = format.writeGeometry(g); - expect(serialized.firstElementChild).to.xmleql(ol.xml.load(text)); + expect(serialized.firstElementChild).to.xmleql(ol.xml.parse(text)); }); it('can read a plural multipolygon geometry', function() { @@ -677,7 +677,7 @@ describe('ol.format.GML3', function() { expect(g.getCoordinates()).to.eql( [[[1, 2, 0], [2, 3, 0]], [[3, 4, 0], [4, 5, 0]]]); var serialized = format.writeGeometry(g); - expect(serialized.firstElementChild).to.xmleql(ol.xml.load(text)); + expect(serialized.firstElementChild).to.xmleql(ol.xml.parse(text)); }); it('can read and write a singular multicurve-curve geometry', function() { @@ -709,7 +709,7 @@ describe('ol.format.GML3', function() { [[[1, 2, 0], [2, 3, 0]], [[3, 4, 0], [4, 5, 0]]]); format = new ol.format.GML({srsName: 'CRS:84', curve: true}); var serialized = format.writeGeometry(g); - expect(serialized.firstElementChild).to.xmleql(ol.xml.load(text)); + expect(serialized.firstElementChild).to.xmleql(ol.xml.parse(text)); }); }); @@ -757,7 +757,7 @@ describe('ol.format.GML3', function() { [[3, 4, 0], [3, 6, 0], [5, 6, 0], [3, 4, 0]]], [[[1, 2, 0], [3, 2, 0], [3, 4, 0], [1, 2, 0]]]]); var serialized = format.writeGeometry(g); - expect(serialized.firstElementChild).to.xmleql(ol.xml.load(text)); + expect(serialized.firstElementChild).to.xmleql(ol.xml.parse(text)); }); it('can read a plural multisurface geometry', function() { @@ -852,7 +852,7 @@ describe('ol.format.GML3', function() { [[[1, 2, 0], [3, 2, 0], [3, 4, 0], [1, 2, 0]]]]); format = new ol.format.GML({srsName: 'CRS:84', surface: true}); var serialized = format.writeGeometry(g); - expect(serialized.firstElementChild).to.xmleql(ol.xml.load(text)); + expect(serialized.firstElementChild).to.xmleql(ol.xml.parse(text)); }); }); @@ -979,7 +979,7 @@ describe('ol.format.GML3', function() { it('writes back features as GML', function() { this.timeout(4000); var serialized = gmlFormat.writeFeatures(features); - expect(serialized).to.xmleql(ol.xml.load(text)); + expect(serialized).to.xmleql(ol.xml.parse(text)); }); }); diff --git a/test/spec/ol/format/gpxformat.test.js b/test/spec/ol/format/gpxformat.test.js index d26b101553..482a640856 100644 --- a/test/spec/ol/format/gpxformat.test.js +++ b/test/spec/ol/format/gpxformat.test.js @@ -56,7 +56,7 @@ describe('ol.format.GPX', function() { expect(f.get('number')).to.be(1); expect(f.get('type')).to.be('Type'); var serialized = format.writeFeatures(fs); - expect(serialized).to.xmleql(ol.xml.load(text)); + expect(serialized).to.xmleql(ol.xml.parse(text)); }); it('can read and write a rte with multiple rtepts', function() { @@ -76,7 +76,7 @@ describe('ol.format.GPX', function() { expect(g.getCoordinates()).to.eql([[2, 1, 0, 0], [4, 3, 0, 0]]); expect(g.getLayout()).to.be(ol.geom.GeometryLayout.XYZM); var serialized = format.writeFeatures(fs); - expect(serialized).to.xmleql(ol.xml.load(text)); + expect(serialized).to.xmleql(ol.xml.parse(text)); }); it('can transform, read and write a rte', function() { @@ -104,7 +104,7 @@ describe('ol.format.GPX', function() { var serialized = format.writeFeatures(fs, { featureProjection: 'EPSG:3857' }); - expect(serialized).to.xmleql(ol.xml.load(text)); + expect(serialized).to.xmleql(ol.xml.parse(text)); }); }); @@ -156,7 +156,7 @@ describe('ol.format.GPX', function() { expect(f.get('number')).to.be(1); expect(f.get('type')).to.be('Type'); var serialized = format.writeFeatures(fs); - expect(serialized).to.xmleql(ol.xml.load(text)); + expect(serialized).to.xmleql(ol.xml.parse(text)); }); it('can read and write a trk with an empty trkseg', function() { @@ -175,7 +175,7 @@ describe('ol.format.GPX', function() { expect(g.getCoordinates()).to.eql([[]]); expect(g.getLayout()).to.be(ol.geom.GeometryLayout.XYZM); var serialized = format.writeFeatures(fs); - expect(serialized).to.xmleql(ol.xml.load(text)); + expect(serialized).to.xmleql(ol.xml.parse(text)); }); it('can read/write a trk with a trkseg with multiple trkpts', function() { @@ -205,7 +205,7 @@ describe('ol.format.GPX', function() { ]); expect(g.getLayout()).to.be(ol.geom.GeometryLayout.XYZM); var serialized = format.writeFeatures(fs); - expect(serialized).to.xmleql(ol.xml.load(text)); + expect(serialized).to.xmleql(ol.xml.parse(text)); }); it('can tranform, read and write a trk with a trkseg', function() { @@ -241,7 +241,7 @@ describe('ol.format.GPX', function() { var serialized = format.writeFeatures(fs, { featureProjection: 'EPSG:3857' }); - expect(serialized).to.xmleql(ol.xml.load(text)); + expect(serialized).to.xmleql(ol.xml.parse(text)); }); it('can read and write a trk with multiple trksegs', function() { @@ -282,7 +282,7 @@ describe('ol.format.GPX', function() { ]); expect(g.getLayout()).to.be(ol.geom.GeometryLayout.XYZM); var serialized = format.writeFeatures(fs); - expect(serialized).to.xmleql(ol.xml.load(text)); + expect(serialized).to.xmleql(ol.xml.parse(text)); }); }); @@ -303,7 +303,7 @@ describe('ol.format.GPX', function() { expect(g.getCoordinates()).to.eql([2, 1, 0, 0]); expect(g.getLayout()).to.be(ol.geom.GeometryLayout.XYZM); var serialized = format.writeFeatures(fs); - expect(serialized).to.xmleql(ol.xml.load(text)); + expect(serialized).to.xmleql(ol.xml.parse(text)); }); it('can transform, read and write a wpt', function() { @@ -326,7 +326,7 @@ describe('ol.format.GPX', function() { var serialized = format.writeFeatures(fs, { featureProjection: 'EPSG:3857' }); - expect(serialized).to.xmleql(ol.xml.load(text)); + expect(serialized).to.xmleql(ol.xml.parse(text)); }); it('can read and write a wpt with ele', function() { @@ -345,7 +345,7 @@ describe('ol.format.GPX', function() { expect(g.getCoordinates()).to.eql([2, 1, 3, 0]); expect(g.getLayout()).to.be(ol.geom.GeometryLayout.XYZM); var serialized = format.writeFeatures(fs); - expect(serialized).to.xmleql(ol.xml.load(text)); + expect(serialized).to.xmleql(ol.xml.parse(text)); }); it('can read and write a wpt with time', function() { @@ -364,7 +364,7 @@ describe('ol.format.GPX', function() { expect(g.getCoordinates()).to.eql([2, 1, 0, 1263115752]); expect(g.getLayout()).to.be(ol.geom.GeometryLayout.XYZM); var serialized = format.writeFeatures(fs); - expect(serialized).to.xmleql(ol.xml.load(text)); + expect(serialized).to.xmleql(ol.xml.parse(text)); }); it('can read and write a wpt with ele and time', function() { @@ -384,7 +384,7 @@ describe('ol.format.GPX', function() { expect(g.getCoordinates()).to.eql([2, 1, 3, 1263115752]); expect(g.getLayout()).to.be(ol.geom.GeometryLayout.XYZM); var serialized = format.writeFeatures(fs); - expect(serialized).to.xmleql(ol.xml.load(text)); + expect(serialized).to.xmleql(ol.xml.parse(text)); }); it('can read and write various wpt attributes', function() { @@ -434,7 +434,7 @@ describe('ol.format.GPX', function() { expect(f.get('ageofdgpsdata')).to.be(9); expect(f.get('dgpsid')).to.be(10); var serialized = format.writeFeatures(fs); - expect(serialized).to.xmleql(ol.xml.load(text)); + expect(serialized).to.xmleql(ol.xml.parse(text)); }); }); diff --git a/test/spec/ol/format/kmlformat.test.js b/test/spec/ol/format/kmlformat.test.js index 83b32c4a72..8267cfe1ce 100644 --- a/test/spec/ol/format/kmlformat.test.js +++ b/test/spec/ol/format/kmlformat.test.js @@ -47,7 +47,7 @@ describe('ol.format.KML', function() { ' https://developers.google.com/kml/schema/kml22gx.xsd">' + ' ' + ''; - expect(node).to.xmleql(ol.xml.load(text)); + expect(node).to.xmleql(ol.xml.parse(text)); }); it('can write a Feature\'s id', function() { @@ -63,7 +63,7 @@ describe('ol.format.KML', function() { ' https://developers.google.com/kml/schema/kml22gx.xsd">' + ' ' + ''; - expect(node).to.xmleql(ol.xml.load(text)); + expect(node).to.xmleql(ol.xml.parse(text)); }); }); @@ -94,7 +94,7 @@ describe('ol.format.KML', function() { ' https://developers.google.com/kml/schema/kml22gx.xsd">' + ' ' + ''; - expect(node).to.xmleql(ol.xml.load(text)); + expect(node).to.xmleql(ol.xml.parse(text)); }); it('can read Point geometries', function() { @@ -206,7 +206,7 @@ describe('ol.format.KML', function() { ' ' + ' ' + ''; - expect(node).to.xmleql(ol.xml.load(text)); + expect(node).to.xmleql(ol.xml.parse(text)); }); it('can write XYZ Point geometries', function() { @@ -226,7 +226,7 @@ describe('ol.format.KML', function() { ' ' + ' ' + ''; - expect(node).to.xmleql(ol.xml.load(text)); + expect(node).to.xmleql(ol.xml.parse(text)); }); it('can transform and write XYZ Point geometries', function() { @@ -258,7 +258,7 @@ describe('ol.format.KML', function() { ' ' + ' ' + ''; - expect(node).to.xmleql(ol.xml.load(text)); + expect(node).to.xmleql(ol.xml.parse(text)); ol.proj.removeTransform( ol.proj.get('EPSG:4326'), ol.proj.get('double')); @@ -283,7 +283,7 @@ describe('ol.format.KML', function() { ' ' + ' ' + ''; - expect(node).to.xmleql(ol.xml.load(text)); + expect(node).to.xmleql(ol.xml.parse(text)); }); it('can write XYZM Point geometries', function() { @@ -303,7 +303,7 @@ describe('ol.format.KML', function() { ' ' + ' ' + ''; - expect(node).to.xmleql(ol.xml.load(text)); + expect(node).to.xmleql(ol.xml.parse(text)); }); it('can read LineString geometries', function() { @@ -341,7 +341,7 @@ describe('ol.format.KML', function() { ' ' + ' ' + ''; - expect(node).to.xmleql(ol.xml.load(text)); + expect(node).to.xmleql(ol.xml.parse(text)); }); it('can write XYZ LineString geometries', function() { @@ -362,7 +362,7 @@ describe('ol.format.KML', function() { ' ' + ' ' + ''; - expect(node).to.xmleql(ol.xml.load(text)); + expect(node).to.xmleql(ol.xml.parse(text)); }); it('can write XYM LineString geometries', function() { @@ -383,7 +383,7 @@ describe('ol.format.KML', function() { ' ' + ' ' + ''; - expect(node).to.xmleql(ol.xml.load(text)); + expect(node).to.xmleql(ol.xml.parse(text)); }); it('can write XYZM LineString geometries', function() { @@ -404,7 +404,7 @@ describe('ol.format.KML', function() { ' ' + ' ' + ''; - expect(node).to.xmleql(ol.xml.load(text)); + expect(node).to.xmleql(ol.xml.parse(text)); }); it('can read LinearRing geometries', function() { @@ -443,7 +443,7 @@ describe('ol.format.KML', function() { ' ' + ' ' + ''; - expect(node).to.xmleql(ol.xml.load(text)); + expect(node).to.xmleql(ol.xml.parse(text)); }); it('can write XYZ LinearRing geometries', function() { @@ -464,7 +464,7 @@ describe('ol.format.KML', function() { ' ' + ' ' + ''; - expect(node).to.xmleql(ol.xml.load(text)); + expect(node).to.xmleql(ol.xml.parse(text)); }); it('can write XYM LinearRing geometries', function() { @@ -485,7 +485,7 @@ describe('ol.format.KML', function() { ' ' + ' ' + ''; - expect(node).to.xmleql(ol.xml.load(text)); + expect(node).to.xmleql(ol.xml.parse(text)); }); it('can write XYZM LinearRing geometries', function() { @@ -506,7 +506,7 @@ describe('ol.format.KML', function() { ' ' + ' ' + ''; - expect(node).to.xmleql(ol.xml.load(text)); + expect(node).to.xmleql(ol.xml.parse(text)); }); it('can read Polygon geometries', function() { @@ -554,7 +554,7 @@ describe('ol.format.KML', function() { ' ' + ' ' + ''; - expect(node).to.xmleql(ol.xml.load(text)); + expect(node).to.xmleql(ol.xml.parse(text)); }); it('can write XYZ Polygon geometries', function() { @@ -581,7 +581,7 @@ describe('ol.format.KML', function() { ' ' + ' ' + ''; - expect(node).to.xmleql(ol.xml.load(text)); + expect(node).to.xmleql(ol.xml.parse(text)); }); it('can write XYM Polygon geometries', function() { @@ -608,7 +608,7 @@ describe('ol.format.KML', function() { ' ' + ' ' + ''; - expect(node).to.xmleql(ol.xml.load(text)); + expect(node).to.xmleql(ol.xml.parse(text)); }); it('can write XYZM Polygon geometries', function() { @@ -634,7 +634,7 @@ describe('ol.format.KML', function() { ' ' + ' ' + ''; - expect(node).to.xmleql(ol.xml.load(text)); + expect(node).to.xmleql(ol.xml.parse(text)); }); it('can read complex Polygon geometries', function() { @@ -706,7 +706,7 @@ describe('ol.format.KML', function() { ' ' + ' ' + ''; - expect(node).to.xmleql(ol.xml.load(text)); + expect(node).to.xmleql(ol.xml.parse(text)); }); it('can read MultiPoint geometries', function() { @@ -755,7 +755,7 @@ describe('ol.format.KML', function() { ' ' + ' ' + ''; - expect(node).to.xmleql(ol.xml.load(text)); + expect(node).to.xmleql(ol.xml.parse(text)); }); it('can read MultiLineString geometries', function() { @@ -805,7 +805,7 @@ describe('ol.format.KML', function() { ' ' + ' ' + ''; - expect(node).to.xmleql(ol.xml.load(text)); + expect(node).to.xmleql(ol.xml.parse(text)); }); it('can read MultiPolygon geometries', function() { @@ -873,7 +873,7 @@ describe('ol.format.KML', function() { ' ' + ' ' + ''; - expect(node).to.xmleql(ol.xml.load(text)); + expect(node).to.xmleql(ol.xml.parse(text)); }); it('can read empty GeometryCollection geometries', function() { @@ -1140,7 +1140,7 @@ describe('ol.format.KML', function() { ' My description' + ' ' + ''; - expect(node).to.xmleql(ol.xml.load(text)); + expect(node).to.xmleql(ol.xml.parse(text)); }); it('can write Feature\'s boolean attributes', function() { @@ -1160,7 +1160,7 @@ describe('ol.format.KML', function() { ' 0' + ' ' + ''; - expect(node).to.xmleql(ol.xml.load(text)); + expect(node).to.xmleql(ol.xml.parse(text)); }); }); @@ -1608,7 +1608,7 @@ describe('ol.format.KML', function() { ' ' + ' ' + ''; - expect(node).to.xmleql(ol.xml.load(text)); + expect(node).to.xmleql(ol.xml.parse(text)); }); it('can write an feature\'s text style', function() { @@ -1640,7 +1640,7 @@ describe('ol.format.KML', function() { ' ' + ' ' + ''; - expect(node).to.xmleql(ol.xml.load(text)); + expect(node).to.xmleql(ol.xml.parse(text)); }); it('can write an feature\'s stroke style', function() { @@ -1668,7 +1668,7 @@ describe('ol.format.KML', function() { ' ' + ' ' + ''; - expect(node).to.xmleql(ol.xml.load(text)); + expect(node).to.xmleql(ol.xml.parse(text)); }); it('can write an feature\'s fill style', function() { @@ -1694,7 +1694,7 @@ describe('ol.format.KML', function() { ' ' + ' ' + ''; - expect(node).to.xmleql(ol.xml.load(text)); + expect(node).to.xmleql(ol.xml.parse(text)); }); }); @@ -2210,7 +2210,7 @@ describe('ol.format.KML', function() { ' ' + ' ' + ''; - expect(node).to.xmleql(ol.xml.load(text)); + expect(node).to.xmleql(ol.xml.parse(text)); }); }); diff --git a/test/spec/ol/format/owsformat.test.js b/test/spec/ol/format/owsformat.test.js index d79c7439fb..03adf24096 100644 --- a/test/spec/ol/format/owsformat.test.js +++ b/test/spec/ol/format/owsformat.test.js @@ -7,7 +7,7 @@ describe('ol.format.OWS 1.1', function() { var parser = new ol.format.OWS(); it('should read ServiceProvider tag properly', function() { - var doc = ol.xml.load( + var doc = ol.xml.parse( '' + '' + @@ -56,7 +56,7 @@ describe('ol.format.OWS 1.1', function() { }); it('should read ServiceIdentification tag properly', function() { - var doc = ol.xml.load( + var doc = ol.xml.parse( '' + '' + @@ -86,7 +86,7 @@ describe('ol.format.OWS 1.1', function() { }); it('should read OperationsMetadata tag properly', function() { - var doc = ol.xml.load( + var doc = ol.xml.parse( '' + '' + diff --git a/test/spec/ol/format/wfsformat.test.js b/test/spec/ol/format/wfsformat.test.js index 3362c3877d..06f1686986 100644 --- a/test/spec/ol/format/wfsformat.test.js +++ b/test/spec/ol/format/wfsformat.test.js @@ -179,7 +179,7 @@ describe('ol.format.WFS', function() { srsName: 'urn:ogc:def:crs:EPSG::4326', propertyNames: ['STATE_NAME', 'STATE_FIPS', 'STATE_ABBR'] }); - expect(serialized).to.xmleql(ol.xml.load(text)); + expect(serialized).to.xmleql(ol.xml.parse(text)); }); it('creates paging headers', function() { @@ -204,7 +204,7 @@ describe('ol.format.WFS', function() { featurePrefix: 'topp', featureTypes: ['states'] }); - expect(serialized).to.xmleql(ol.xml.load(text)); + expect(serialized).to.xmleql(ol.xml.parse(text)); }); it('creates a BBOX filter', function() { @@ -231,7 +231,7 @@ describe('ol.format.WFS', function() { geometryName: 'the_geom', bbox: [1, 2, 3, 4] }); - expect(serialized.firstElementChild).to.xmleql(ol.xml.load(text)); + expect(serialized.firstElementChild).to.xmleql(ol.xml.parse(text)); }); }); @@ -247,7 +247,7 @@ describe('ol.format.WFS', function() { 'http://schemas.opengis.net/wfs/1.1.0/wfs.xsd"/>'; var serialized = new ol.format.WFS().writeTransaction(null, null, null, {handle: 'handle_t'}); - expect(serialized).to.xmleql(ol.xml.load(text)); + expect(serialized).to.xmleql(ol.xml.parse(text)); }); }); @@ -278,7 +278,7 @@ describe('ol.format.WFS', function() { featurePrefix: 'feature', gmlOptions: {multiCurve: true, srsName: 'EPSG:900913'} }); - expect(serialized).to.xmleql(ol.xml.load(text)); + expect(serialized).to.xmleql(ol.xml.parse(text)); }); }); @@ -309,7 +309,7 @@ describe('ol.format.WFS', function() { featurePrefix: 'foo', gmlOptions: {srsName: 'EPSG:900913'} }); - expect(serialized).to.xmleql(ol.xml.load(text)); + expect(serialized).to.xmleql(ol.xml.parse(text)); }); }); @@ -350,7 +350,7 @@ describe('ol.format.WFS', function() { featureType: 'states', featurePrefix: 'topp' }); - expect(serialized).to.xmleql(ol.xml.load(text)); + expect(serialized).to.xmleql(ol.xml.parse(text)); }); }); @@ -377,7 +377,7 @@ describe('ol.format.WFS', function() { value: 'Another native line goes here' }] }); - expect(serialized).to.xmleql(ol.xml.load(text)); + expect(serialized).to.xmleql(ol.xml.parse(text)); }); }); @@ -397,7 +397,7 @@ describe('ol.format.WFS', function() { featureTypes: ['states', 'cities'], featurePrefix: 'topp' }); - expect(serialized).to.xmleql(ol.xml.load(text)); + expect(serialized).to.xmleql(ol.xml.parse(text)); }); });