ddn.data.xml.dom.document
DOM document node.
fn buildXml
Types 5
structXmlNotationDecl
A DTD notation declaration.
Fields
string nameNotation name.string systemIdOptional system identifier.string publicIdOptional public identifier.structXmlUnparsedEntityDecl
A DTD unparsed entity declaration (NDATA).
Fields
string nameEntity name.string systemIdOptional system identifier.string publicIdOptional public identifier.string notationNameNotation name referenced by `NDATA`.classXmlDocument : XmlParentNode
An XML document.
A document owns a list of top-level children, but in well-formed XML it must contain exactly one root element (the document element). For now, we enforce a conservative subset:
- At most one
XmlElementmay be a direct child.
Fields
string xmlVersionXML version as declared by `<?xml version='...'?>`.string xmlEncodingEncoding label as declared by `<?xml encoding='...'?>`.bool hasEncodingDeclarationWhether an `encoding` pseudo-attribute was explicitly provided in the XML declaration.bool hasStandaloneWhether a `standalone` flag was explicitly provided in the XML declaration.bool standaloneStandalone value if `hasStandalone` is `true`.XmlError[] recoverErrorsRecover-mode parse errors collected during best-effort parsing.XmlEntityTable entityTableEntity declarations collected from the DTD internal subset.XmlDtd dtdDTD declarations collected from internal/external subsets.bool useArenaAllocatorWhether this document uses an internal arena allocator for storing strings.XmlArena arenaPer-document arena allocator used when `useArenaAllocator` is `true`.Methods
XmlDocumentType doctype() @property @safeReturns the document type declaration associated with this document.XmlDOMImplementation implementation() @property @safeReturns the DOM implementation object that handles this document.XmlProcessingInstruction createProcessingInstruction(string target, string data) @safeCreates a processing instruction.XmlElement[] getElementsByTagName(string tagname) @safeReturns all elements in the document with the given tag name.inout(XmlElement) documentElement() @property inout @safe nothrowReturns the document element (root element), or `null` if not present.XmlNotationDecl[] notations() const @safeReturns all DTD notation declarations in deterministic (name-sorted) order.bool tryGetNotation(string name, out XmlNotationDecl decl) const @safe nothrowLooks up a notation by name.XmlUnparsedEntityDecl[] unparsedEntities() const @safeReturns all unparsed entity declarations in deterministic (name-sorted) order.bool tryGetUnparsedEntity(string name, out XmlUnparsedEntityDecl decl) const @safe nothrowLooks up an unparsed entity by name.XmlNode importNode(XmlNode node, bool deep = true) @safeImports `node` into this document by cloning it.Constructors
this(XmlLocation location = XmlLocation.init)structXmlBuilder
A helper struct for declarative DOM construction.
Fields
private XmlParentNode _currentMethods
Constructors
this(XmlParentNode parent)Creates a builder starting at the given parent.classXmlDOMImplementation
DOM implementation object.
Methods
bool hasFeature(string feature, string version_) @safeTests if the DOM implementation implements a specific feature.