Parse an XML document and return the root element's value. Throws on an empty or
root-less document and on an unterminated comment, CDATA section, processing
instruction, declaration or tag. Unbalanced close tags are ignored defensively
rather than throwing, so a slightly malformed feed still yields its data.
The tokenizer is a single forward scan (indexOf for every terminator), so
parsing time is linear in the size of the body, whatever it contains.
Parse an XML document and return the root element's value. Throws on an empty or root-less document and on an unterminated comment, CDATA section, processing instruction, declaration or tag. Unbalanced close tags are ignored defensively rather than throwing, so a slightly malformed feed still yields its data.
The tokenizer is a single forward scan (
indexOffor every terminator), so parsing time is linear in the size of the body, whatever it contains.