The goog.dom.xml Namespace

.MAX_ELEMENT_DEPTH {number}

Max XML size for MSXML2. Used to prevent potential DoS attacks.

.MAX_XML_SIZE_KB {number}

Max XML size for MSXML2. Used to prevent potential DoS attacks.

.createDocument(opt_rootTagName, opt_namespaceUri)

Creates an XML document appropriate for the current JS runtime

opt_rootTagName {string=}
The root tag name.
opt_namespaceUri {string=}
Namespace URI of the document element.
returns {Document}
The new document.

.loadXml(xml)

Creates an XML document from a string

xml {string}
The text.
returns {Document}
XML document from the text.

.selectNodes(node, path)

Selects multiple nodes using an Xpath expression and a root node

node {Node}
The root node.
path {string}
Xpath selector.
returns {(NodeList,Array.<Node>)}
The selected nodes, or empty array if no matching nodes.

.selectSingleNode(node, path)

Selects a single node using an Xpath expression and a root node

node {Node}
The root node.
path {string}
Xpath selector.
returns {Node}
The selected node, or null if no matching node.

.serialize(xml)

Serializes an XML document or subtree to string.

xml {Document|Element}
The document or the root node of the subtree.
returns {string}
The serialized XML.

.setAttributes(element, attributes)

Sets multiple attributes on an element. Differs from goog.dom.setProperties in that it exclusively uses the element's setAttributes method. Use this when you need to ensure that the exact property is available as an attribute and can be read later by the native getAttribute method.

element {!Element}
XML or DOM element to set attributes on.
attributes {!Object.<string, string>}
Map of property:value pairs.