Skip to content
FutureBlitz

    Install

    Import std.data.xml_reader

    std.data.xml_reader

    XmlReader: XML 1.0's documents read as a stream of events, a start and an end for each element and one for each run of text, CDATA section, comment, and processing instruction in them, as a non-validating processor reads them. Line ends are LFs, entity and character references are replaced by their text, attributes are normalized, and the document type's internal subset is read for its entities and its attributes' defaults and types. The document type's external subset, and external entities, aren't read; a reference to an undeclared entity is an error, but in a document whose external subset or external parameter entities could declare it, where it's left out. Names keep their namespaces' prefixes, which aren't resolved.

    std/data/xml_reader.fb

    Types

    XmlEventKind enum

    Public Enum XmlEventKind

    What an XmlEvent is.

    std/data/xml_reader.fb, line 15

    • START enum member #

      An element's start tag.

    • END enum member #

      An element's end tag, which an empty element has right after its START too.

    • TEXT enum member #

      Text.

    • CDATA enum member #

      A CDATA section's text.

    • COMMENT enum member #

      A comment.

    • INSTRUCTION enum member #

      A processing instruction.

    XmlEvent class

    Public Class XmlEvent

    One part of a document, from an XmlReader.

    std/data/xml_reader.fb, line 31

    • Public ReadOnly Field Kind: XmlEventKind field #

      Which part of the document it is.

    • Public ReadOnly Field Name: String field #

      A START's or END's element name, or an INSTRUCTION's target.

    • Public ReadOnly Field Text: String field #

      A TEXT's, CDATA's, COMMENT's, or INSTRUCTION's text.

    • Public ReadOnly Field Attributes: Map<String, String> field #

      A START's attributes, by name, in the order they're written, then their defaults'.

    XmlReader class

    Public Class XmlReader

    Reads an XML document as a stream of events: a start and an end for each element, and one for each run of text, CDATA section, comment, and processing instruction.

    std/data/xml_reader.fb, line 51

    • Public New(text: String) constructor #

      A reader of text's document, its line ends LFs, and past a byte order mark at its start.

    • Public Method Next(): XmlEvent? Throws ParseError method #

      The next event, or Null at the document's end. Throws a ParseError, with its line and column, of UNEXPECTED_END for a document that ends inside an element or markup, and of SYNTAX for the rest that isn't well-formed XML 1.0.

    Report an issue with this page or with FutureBlitz on GitHub.