Module std.experimental.xml.dom

This module declares the DOM Level 3 interfaces as stated in the W3C DOM specification.

For a more complete reference, see the official specification, from which all documentation in this module is taken.

Interfaces

Name Description
Attr The Attr interface represents an attribute in an Element object. Typically the allowable values for the attribute are defined in a schema associated with the document.
CDATASection CDATA sections are used to escape blocks of text containing characters that would otherwise be regarded as markup. The only delimiter that is recognized in a CDATA section is the "]]>" string that ends the CDATA section. CDATA sections cannot be nested. Their primary purpose is for including material such as XML fragments, without needing to escape all the delimiters.
CharacterData The CharacterData interface extends Node with a set of attributes and methods for accessing character data in the DOM. For clarity this set is defined here rather than on each object that uses these attributes and methods. No DOM objects correspond directly to CharacterData, though Text and others do inherit the interface from it. All offsets in this interface start from 0.
Comment This interface inherits from CharacterData and represents the content of a comment, i.e., all the characters between the starting ''.
Document The Document interface represents the entire HTML or XML document. Conceptually, it is the root of the document tree, and provides the primary access to the document's data.
DocumentFragment DocumentFragment is a "lightweight" or "minimal" Document object. It is very common to want to be able to extract a portion of a document's tree or to create a new fragment of a document. Imagine implementing a user command like cut or rearranging a document by moving fragments around. It is desirable to have an object which can hold such fragments and it is quite natural to use a Node for this purpose. While it is true that a Document object could fulfill this role, a Document object can potentially be a heavyweight object, depending on the underlying implementation. What is really needed for this is a very lightweight object. DocumentFragment is such an object.
DocumentType Each Document has a doctype attribute whose value is either null or a DocumentType object. The DocumentType interface in the DOM Core provides an interface to the list of entities that are defined for the document, and little else because the effect of namespaces and the various XML schema efforts on DTD representation are not clearly understood as of this writing.
DOMConfiguration The DOMConfiguration interface represents the configuration of a document and maintains a table of recognized parameters. Using the configuration, it is possible to change Document.normalizeDocument behavior, such as replacing the CDATASection nodes with Text nodes or specifying the type of the schema that must be used when the validation of the Document is requested.
DOMError DOMError is an interface that describes an error.
DOMImplementation The DOMImplementation interface provides a number of methods for performing operations that are independent of any particular instance of the document object model.
DOMImplementationList The DOMImplementationList interface provides the abstraction of an ordered collection of DOM implementations, without defining or constraining how this collection is implemented. The items in the DOMImplementationList are accessible via an integral index, starting from 0.
DOMImplementationSource This interface permits a DOM implementer to supply one or more implementations, based upon requested features and versions, as specified in DOM Features. Each implemented DOMImplementationSource object is listed in the binding-specific list of available sources so that its DOMImplementation objects are made available.
DOMLocator DOMLocator is an interface that describes a location (e.g. where an error occurred).
DOMStringList The DOMStringList interface provides the abstraction of an ordered collection of DOMString values, without defining or constraining how this collection is implemented. The items in the DOMStringList are accessible via an integral index, starting from 0.
Entity This interface represents a known entity, either parsed or unparsed, in an XML document. Note that this models the entity itself not the entity declaration.
EntityReference EntityReference nodes may be used to represent an entity reference in the tree. When an EntityReference node represents a reference to an unknown entity, the node has no children and its replacement value, when used by Attr.value for example, is empty.
NamedNodeMap Objects implementing the NamedNodeMap interface are used to represent collections of nodes that can be accessed by name. Note that NamedNodeMap does not inherit from NodeList; NamedNodeMaps are not maintained in any particular order. Objects contained in an object implementing NamedNodeMap may also be accessed by an ordinal index, but this is simply to allow convenient enumeration of the contents of a NamedNodeMap, and does not imply that the DOM specifies an order to these Nodes.
Node The Node interface is the primary datatype for the entire Document Object Model. It represents a single node in the document tree. While all objects implementing the Node interface expose methods for dealing with children, not all objects implementing the Node interface may have children. For example, Text nodes may not have children, and adding children to such nodes results in a DOMException being raised.
NodeList The NodeList interface provides the abstraction of an ordered collection of nodes, without defining or constraining how this collection is implemented. NodeList objects in the DOM are live.
Notation This interface represents a notation declared in the DTD. A notation either declares, by name, the format of an unparsed entity or is used for formal declaration of processing instruction targets. The nodeName attribute inherited from Node is set to the declared name of the notation.
ProcessingInstruction The ProcessingInstruction interface represents a "processing instruction", used in XML as a way to keep processor-specific information in the text of the document.
Text The Text interface inherits from CharacterData and represents the textual content (termed character data in XML) of an Element or Attr. If there is no markup inside an element's content, the text is contained in a single object implementing the Text interface that is the only child of the element. If there is markup, it is parsed into the information items (elements, comments, etc.) and Text nodes that form the list of children of the element.
XMLTypeInfo The TypeInfo interface represents a type referenced from Element or Attr nodes, specified in the schemas associated with the document. The type is a pair of a namespace URI and name properties, and depends on the document's schema.

Classes

Name Description
DOMException DOM operations only raise exceptions in "exceptional" circumstances, i.e., when an operation is impossible to perform (either for logical reasons, because data is lost, or because the implementation has become unstable). In general, DOM methods return specific error values in ordinary processing situations, such as out-of-bound errors when using NodeList.

Enums

Name Description
DocumentPosition A bitmask indicating the relative document position of a node with respect to another node. Returned by Node.compareDocumentPosition.
ErrorSeverity An integer indicating the severity of a DOMError.
ExceptionCode An integer indicating the type of error generated.
NodeType An integer indicating which type of node this is.
UserDataOperation An integer indicating the type of operation being performed on a node.

Aliases

Name Type Description
UserData std.variant.VariantN!(32L) The DOMUserData type is used to store application data inside DOM nodes.
UserDataHandler void delegate(UserDataOperation, DOMString, UserData, Node!DOMString, Node!DOMString) When associating an object to a key on a node using Node.setUserData() the application can provide a handler that gets called when the node the object is associated to is being cloned, imported, or renamed. This can be used by the application to implement various behaviors regarding the data it associates to the DOM nodes.

Authors

Lodovico Giaretta

Copyright

Copyright Lodovico Giaretta 2016 --

License

Boost License 1.0.