parseXmlDocument function

XmlElement parseXmlDocument(
  1. String source
)

Parses source into its root XmlElement.

A deliberately small, dependency-free reader: elements, attributes, self-closing tags, entity references in attribute values, and the usual prologue noise (<?xml …?>, comments, <!DOCTYPE …>, CDATA). Namespaces are not resolved — prefixes are stripped from element names.

Throws a FormatException on malformed input.

Implementation

XmlElement parseXmlDocument(String source) => _XmlParser(source).parseDocument();