pub trait DocumentDecl: Document {
fn xml_declaration(&self) -> Option<XmlDecl>;
fn set_xml_declaration(&mut self, xml_decl: XmlDecl) -> Result<()>;
}
Expand description
This interface extends the DOM standard Document
and allows the setting, and retrieval,
of the XML declaration from the document prolog.
Specification
From XML 1.1 §2.8 Prolog and Document Type Declaration – Definition: XML 1.1 documents must begin with an XML declaration which specifies the version of XML being used.
From XML 1.0 – Definition: XML documents should begin with an XML declaration which specifies the version of XML being used.
Required Methods
fn xml_declaration(&self) -> Option<XmlDecl>
fn xml_declaration(&self) -> Option<XmlDecl>
Retrieve the current XML declaration, if set.
fn set_xml_declaration(&mut self, xml_decl: XmlDecl) -> Result<()>
fn set_xml_declaration(&mut self, xml_decl: XmlDecl) -> Result<()>
Set the current XML declaration for this document.
Note that it is not possible to unset (set to None
) this value.