pub struct XmlDtd {Show 14 fields
pub name: Option<String>,
pub public_id: Option<String>,
pub system_id: Option<String>,
pub int_subset: Option<String>,
pub entities: HashMap<String, String>,
pub parameter_entities: HashMap<String, String>,
pub unparsed_entities: HashSet<String>,
pub notations: HashSet<String>,
pub ndata_notations: Vec<String>,
pub has_parameter_entity_refs: bool,
pub namespace_errors: Vec<String>,
pub elements: HashMap<String, ElementDecl>,
pub duplicate_elements: Vec<String>,
pub attributes: HashMap<(String, String), AttrDecl>,
}Expand description
Parsed DTD attached to a document (xmlDtd).
Fields§
§name: Option<String>§public_id: Option<String>§system_id: Option<String>§int_subset: Option<String>§entities: HashMap<String, String>General entity name → replacement text.
parameter_entities: HashMap<String, String>Parameter entity name → replacement.
unparsed_entities: HashSet<String>Names of entities declared with an NDATA annotation. An attribute of type ENTITY must name one of these, which needs them kept apart from parsed entities rather than lumped in with them.
notations: HashSet<String>Notation names declared by <!NOTATION>. We parsed those declarations
and threw the name away, so nothing could check that an NDATA
annotation or a NOTATION attribute type names one that exists.
ndata_notations: Vec<String>Notation names referenced by an NDATA annotation, kept so the “Notation Declared” constraint can be checked once the whole subset is read rather than in declaration order.
has_parameter_entity_refs: boolThe internal subset used a parameter entity reference, so the set of entity declarations may be incomplete. XML 1.0 4.1 turns “Entity Declared” from a well-formedness constraint into a validity one in that case: an unresolvable entity must not kill the parse.
namespace_errors: Vec<String>Namespace errors found while reading the subset – a colon in an entity or notation name. Merged into the document’s list.
elements: HashMap<String, ElementDecl>Element name → content model.
duplicate_elements: Vec<String>Element types declared more than once. A map cannot represent that, and “Unique Element Type Declaration” is a validity constraint, so it has to be recorded as the declarations go by and reported at validation time rather than at parse time.
attributes: HashMap<(String, String), AttrDecl>(element, attribute) → declaration.