vxml/xml_streamer

Token-level XML streaming utilities.

This module exposes the lower-level token stream used by VXML’s streaming XML parser. Most callers can use vxml.xml_to_vxml instead. Use this module when an application needs to inspect or transform XML events before they become a VXML tree.

Types

A token produced by the XML streamer.

pub type Event {
  Newline(blame: blame.Blame)
  TagStartOrdinary(blame: blame.Blame, load: String)
  TagStartXMLVersion(blame: blame.Blame, load: String)
  DoctypeStartSequence(blame: blame.Blame)
  DoctypeContents(blame: blame.Blame, load: String)
  DoctypeEndSequence(blame: blame.Blame)
  TagStartClosing(blame: blame.Blame, load: String)
  InTagWhitespace(blame: blame.Blame, load: String)
  Key(blame: blame.Blame, load: String)
  KeyMalformed(blame: blame.Blame, load: String)
  Assignment(blame: blame.Blame)
  ValueDoubleQuoted(blame: blame.Blame, load: String)
  ValueSingleQuoted(blame: blame.Blame, load: String)
  ValueUnquoted(blame: blame.Blame, load: String)
  ValueMalformed(blame: blame.Blame, load: String)
  TagEndOrdinary(blame: blame.Blame)
  TagEndSelfClosing(blame: blame.Blame)
  TagEndXMLVersion(blame: blame.Blame)
  Text(blame: blame.Blame, load: String)
  TextWithUnrecognizedLessThan(blame: blame.Blame, load: String)
  CommentContents(blame: blame.Blame, load: String)
  CommentStartSequence(blame: blame.Blame)
  CommentEndSequence(blame: blame.Blame)
}

Constructors

  • Newline(blame: blame.Blame)

    A physical newline, whether inside or outside a tag.

  • TagStartOrdinary(blame: blame.Blame, load: String)

    The name following the < of an ordinary opening tag.

  • TagStartXMLVersion(blame: blame.Blame, load: String)

    The name following <? at the beginning of an XML declaration.

  • DoctypeStartSequence(blame: blame.Blame)

    The opening sequence of a doctype declaration, <!DOCTYPE.

  • DoctypeContents(blame: blame.Blame, load: String)

    Text inside a doctype declaration.

  • DoctypeEndSequence(blame: blame.Blame)

    The closing sequence of a doctype declaration, >.

  • TagStartClosing(blame: blame.Blame, load: String)

    The name following the </ of a closing tag.

  • InTagWhitespace(blame: blame.Blame, load: String)

    Whitespace occurring inside a tag.

  • Key(blame: blame.Blame, load: String)

    A syntactically valid attribute key.

  • KeyMalformed(blame: blame.Blame, load: String)

    Text encountered where an attribute key was expected.

  • Assignment(blame: blame.Blame)

    An attribute assignment marker, =.

  • ValueDoubleQuoted(blame: blame.Blame, load: String)

    An attribute value delimited by double quotes.

  • ValueSingleQuoted(blame: blame.Blame, load: String)

    An attribute value delimited by single quotes.

  • ValueUnquoted(blame: blame.Blame, load: String)

    An attribute value without surrounding quotes.

  • ValueMalformed(blame: blame.Blame, load: String)

    Text encountered where a quoted attribute value was expected.

  • TagEndOrdinary(blame: blame.Blame)

    The end of an ordinary opening tag, >.

  • TagEndSelfClosing(blame: blame.Blame)

    The end of a self-closing tag, />.

  • TagEndXMLVersion(blame: blame.Blame)

    The end of an XML declaration, ?>.

  • Text(blame: blame.Blame, load: String)

    Text outside a tag; outside-tag whitespace is included here.

  • TextWithUnrecognizedLessThan(blame: blame.Blame, load: String)

    Text containing a < that did not begin a recognized markup construct.

  • CommentContents(blame: blame.Blame, load: String)

    Text inside an XML comment.

  • CommentStartSequence(blame: blame.Blame)

    The opening sequence of an XML comment, <!--.

  • CommentEndSequence(blame: blame.Blame)

    The closing sequence of an XML comment, -->.

Values

pub fn event_digest(e: Event) -> String

Renders one token as a debug string.

pub fn input_lines_streamer(
  lines: List(io_lines.InputLine),
) -> List(Event)

Streams XML tokens from input lines.

All physical newlines are represented. Attribute values cannot span lines. Comment delimiters in invalid positions do not change the streamer’s state.

Search Document