Module xmlrat

Base types representing XML documents and their components.

Description

Base types representing XML documents and their components.

Data Types

attribute()

attribute() = #xml_attribute{name = xmlrat:attrname(), value = xmlrat:attrvalue()}

An XML attribute, which is attached to an element, describing some property of that element.

attrname()

attrname() = xmlname()

The name of an attribute.

attrvalue()

attrvalue() = binary() | [binary() | {entity, binary()} | {parameter, binary()}]

The value of an XML attribute.

comment()

comment() = #xml_comment{text = binary()}

A comment in an XML document, containing arbitrary character data.

component()

component() = prolog() | element() | comment() | pi() | whitespace()

A top-level component within an XML document.

content()

content() = binary() | {entity, binary()} | {parameter, binary()} | element() | pi() | comment()

Possible types of content within an XML document.

document()

document() = [component()]

An XML document, consisting of components.

element()

element() = #xml_element{tag = xmlrat:tag(), attributes = [xmlrat:attribute() | xmlrat:namespace() | xmlrat:whitespace()], content = [xmlrat:content()]}

An XML element, which has a tag, attributes, and content.

extid()

extid() = {system, uri()} | {public, pubid(), uri()}

namespace()

namespace() = #xml_namespace{name = default | xmlrat:nsname(), uri = xmlrat:uri() | xmlrat:attrvalue()}

An XML namespace (xmlns:* attribute), describing a namespace which is available on an element and its children.

nsname()

nsname() = default | binary()

The name of a namespace. Can be the atom default to indicate that no namespace name was given (but a default namespace is in force for the given scope).

pi()

pi() = #xml_pi{target = xmlrat:pitarget(), options = xmlrat:piopts()}

An XML processing instruction.

piopts()

piopts() = binary() | [attribute()]

The parameters to the PI. If these parsed successfully as if they were XML attributes, then the second form is used. Otherwise, the raw parameters as a binary are given.

pitarget()

pitarget() = binary()

The name of a processing instruction's "target" (the first part, specifying the kind of PI it is, e.g. <<"xml-stylesheet">>).

prolog()

prolog() = xmldecl() | xmlrat_dtd:doctype()

A prolog component, which can appear before the first XML element in a document.

pubid()

pubid() = binary()

tag()

tag() = xmlname()

The tag of an XML element.

uri()

uri() = binary()

A URI, encoded as a UTF-8 binary.

whitespace()

whitespace() = binary()

A binary consisting of whitespace characters ([ \r\n\t] etc)

xmldecl()

xmldecl() = #xml{version = xmlrat:xmlver(), encoding = undefined | xmlrat:encoding(), standalone = undefined | yes | no}

The XML document declaration (<?xml version="1.0"...?>).

xmlname()

xmlname() = binary() | xmlnsname() | xmlnsuriname()

An XML name (may be for an element or attribute, or other concept). May have namespace information attached.

xmlnsname()

xmlnsname() = {nsname(), binary()}

An XML name scoped to a namespace, but the namespace has not yet been resolved (e.g. because it isn't defined, but the options given to the parser allow undefined namespaces).

xmlnsuriname()

xmlnsuriname() = {nsname(), binary(), uri()}

An XML name scoped to a namespace, fully resolved with the final URI available.

xmlver()

xmlver() = binary()

XML version, must be <<"1.0">>


Generated by EDoc