Prelude API
    Preparing search index...

    Function parse

    • Parses an XML 1.0 document into an Ast.Document.

      Supported: the XML declaration, comments, processing instructions, a document type declaration with public/system identifiers and an internal subset (kept verbatim, not interpreted), elements, attributes, character data, CDATA sections, the five predefined entities, decimal and hexadecimal character references, Unicode names, and Namespaces in XML 1.0 (prefixes are resolved, xmlns declarations are scoped, xml/xmlns are reserved).

      Not supported by design: DTD processing (declared entities, attribute defaults, validation) and any external resource — a reference to an entity other than the predefined five is an error, so no expansion or fetching can happen. Line ends (\r\n, \r) are normalized to \n first, as XML requires; positions in errors refer to the normalized text.

      Parameters

      • input: string

      Returns Document

      on the first well-formedness or namespace error, with its offset, line and column.