Skip to main content

XmlDtd

Struct XmlDtd 

Source
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: bool

The 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.

Trait Implementations§

Source§

impl Clone for XmlDtd

Source§

fn clone(&self) -> XmlDtd

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for XmlDtd

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for XmlDtd

Source§

fn default() -> XmlDtd

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.