Class: XML

Mapspace.format. XML

A class for reading XML nodes and convert them to Objects or JSON strings.


new XML(xml)

Parameters:
Name Type Description
xml Node

The XML node.

Source:
mapspace/format/xml.js

Extends

  • ol.Object

Methods


convertToJSON(tab)

Converts this XML to JSON string.

Parameters:
Name Type Description
tab string

Optional tabulation instead of common one.

Source:
mapspace/format/xml.js
Throws:

Error if the XML has an invalid node.

Returns:

The JSON string or null if error.

Type
string

convertToObject()

Converts this XML to Object.

Source:
mapspace/format/xml.js
Throws:

Error if the XML has an invalid node.

Returns:

The Object or null if error.

Type
Object