ddn.data.xml.internal.dtd

Internal: DTD parsing (phased).

This module is not part of the public API and may change at any time.

Types 8

Kind of attribute default declaration.

NONENo default semantics (unspecified).
REQUIRED`#REQUIRED`
IMPLIED`#IMPLIED`
FIXED`#FIXED "..."`
DEFAULTA literal default value.

Attribute type in a DTD.

Note

This is intentionally minimal for the phased DTD implementation.
UNKNOWNUnknown/unspecified type.
CDATA`CDATA`
ID`ID`
IDREF`IDREF`
IDREFS`IDREFS`
NMTOKEN`NMTOKEN`
NMTOKENS`NMTOKENS`
ENTITY`ENTITY`
ENTITIES`ENTITIES`
NOTATION`NOTATION`
ENUMERATIONEnumerated type (a fixed set of values).

A DTD general entity declaration.

Fields
string nameEntity name (without `&` and `;`).
string valueReplacement text for internal entities (decoded later).
bool isParameterTrue if this is a parameter entity (`%name;`).

A DTD element declaration.

This stores a raw content model string for now.

Fields
string nameElement name.
string contentModelRaw content model (e.g. `EMPTY`, `ANY`, or parenthesized model).

A DTD attribute declaration.

Fields
string elementNameElement name to which this attribute declaration applies.
string nameAttribute name.
XmlDtdAttributeType typeAttribute type.
string[] enumerationEnumerated values (only meaningful for `ENUMERATION`/`NOTATION`).
XmlDtdAttributeDefaultKind defaultKindDefault kind.
string defaultValueDefault value (for `DEFAULT`/`FIXED`).

A DTD notation declaration.

Fields
string nameNotation name.
string systemIdOptional system identifier.
string publicIdOptional public identifier.

A DTD unparsed entity declaration (NDATA).

Fields
string nameEntity name.
string systemIdOptional system identifier.
string publicIdOptional public identifier.
string notationNameNotation name referenced by `NDATA`.
structXmlDtd

In-memory representation of a DTD.

This is an internal data structure used by the phased DTD parsing/validation pipeline.

Fields
private XmlDtdEntityDecl[string] _entities
private XmlDtdElementDecl[string] _elements
private XmlDtdNotationDecl[string] _notations
private XmlDtdUnparsedEntityDecl[string] _unparsedEntities
private XmlDtdAttributeDecl[][string] _attributesByElement
Methods
void defineEntity(string name, string value, bool isParameter = false) @safeDefines (or redefines) a general entity.
const(XmlDtdEntityDecl) * findEntity(string name) const @safe nothrowLooks up an entity.
void defineElement(string name, string contentModel) @safeDefines (or redefines) an element declaration.
const(XmlDtdElementDecl) * findElement(string name) const @safe nothrowLooks up an element declaration.
void defineNotation(string name, string systemId = "", string publicId = "") @safeDefines (or redefines) a notation.
const(XmlDtdNotationDecl) * findNotation(string name) const @safe nothrowLooks up a notation.
void defineUnparsedEntity(string name, string systemId, string publicId, string notationName) @safeDefines (or redefines) an unparsed entity.
const(XmlDtdUnparsedEntityDecl) * findUnparsedEntity(string name) const @safe nothrowLooks up an unparsed entity.
XmlDtdUnparsedEntityDecl[] unparsedEntities() const @safeReturns all unparsed entity declarations in deterministic (name-sorted) order.
XmlDtdNotationDecl[] notations() const @safeReturns all notation declarations in deterministic (name-sorted) order.
void addAttributeDecl(XmlDtdAttributeDecl decl) @safeAdds an attribute declaration.
const(XmlDtdAttributeDecl)[] attributeDeclsFor(string elementName) const @safe nothrowReturns attribute declarations for `elementName`.