Remove setAttributeNS function from ol/xml

And create a const for the `XMLSchema-instance` URI
This commit is contained in:
Frederic Junod
2018-03-12 08:55:59 +01:00
parent e8341af803
commit ac3c114477
5 changed files with 25 additions and 39 deletions

View File

@@ -25,14 +25,19 @@ import {extend} from './array.js';
/**
* This document should be used when creating nodes for XML serializations. This
* document is also used by {@link module:ol/xml~createElementNS} and
* {@link module:ol/xml~setAttributeNS}
* document is also used by {@link module:ol/xml~createElementNS}
* @const
* @type {Document}
*/
export const DOCUMENT = document.implementation.createDocument('', '', null);
/**
* @type {string}
*/
export const XML_SCHEMA_INSTANCE_URI = 'http://www.w3.org/2001/XMLSchema-instance';
/**
* @param {string} namespaceURI Namespace URI.
* @param {string} qualifiedName Qualified name.
@@ -112,17 +117,6 @@ export function getAttributeNS(node, namespaceURI, name) {
}
/**
* @param {Node} node Node.
* @param {?string} namespaceURI Namespace URI.
* @param {string} name Attribute name.
* @param {string|number} value Value.
*/
export function setAttributeNS(node, namespaceURI, name, value) {
node.setAttributeNS(namespaceURI, name, value);
}
/**
* Parse an XML string to an XML Document.
* @param {string} xml XML.