Class: ol.parser.XML

ol.parser.XML

new XML

Source:
  • xml.js, line 8

Methods

getAttributeNodeNS

Get an attribute node given the namespace URI and local name.
Parameters:
Name Type Description
node Element Node on which to search for attribute nodes.
uri string Namespace URI.
name string Local name of the attribute (without the prefix).
Source:
  • xml.js, line 99
Returns:
An attribute node or null if none found.
Type
?Element

getAttributeNS

Get an attribute value given the namespace URI and local name.
Parameters:
Name Type Description
node Element Node on which to search for an attribute.
uri string Namespace URI.
name string Local name of the attribute (without the prefix).
Source:
  • xml.js, line 130
Returns:
An attribute value or and empty string if none found.
Type
string

getChildValue

Get the textual value of the node if it exists, or return an optional default string. Returns an empty string if no first child exists and no default value is supplied.
Parameters:
Name Type Description
node Element The element used to look for a first child value.
def string Optional string to return in the event that no first child value exists.
Source:
  • xml.js, line 73
Returns:
The value of the first child of the given node.
Type
string

readChildNodes

Shorthand for applying the named readers to all children of a node. For each child of type 1 (element), is called.
Parameters:
Name Type Description
node Element | Document The node to be read (required).
obj Object The object to be modified (optional).
Source:
  • xml.js, line 47
Returns:
The input object, modified.
Type
Object

readNode

Shorthand for applying one of the named readers given the node namespace and local name. Readers take two args (node, obj) and generally extend or modify the second.
Parameters:
Name Type Description
node Element | Document The node to be read (required).
obj Object The object to be modified (optional).
Source:
  • xml.js, line 22
Returns:
The input object, modified (or a new one if none was provided).
Type
Object