SimpleXmlReader class

A simple and fast xml reader that converts an XML string into a JSON object. Ignores tags that start with "<!" or "<?" as these are usually comments, XML schema, or doctype tags. Supports CData tag: <![[CData ]]> Can extract all namespaces in the document.

Constructors

SimpleXmlReader(boolean)

Methods

parse(string)

Parse an XML string into an XmlDocument object.

Constructor Details

SimpleXmlReader(boolean)

new SimpleXmlReader(parseNamespaces?: boolean)

Parameters

parseNamespaces

boolean

A boolean that indicates if namespaces should be parsed for the document. Default: true.

Method Details

parse(string)

Parse an XML string into an XmlDocument object.

function parse(xml: string): XmlDocument

Parameters

xml

string

The xml string to parse.

Returns

An XmlDocument object generated from an xml string.