[−][src]Module xml_dom::level2
Implementation for DOM Core Level 2.
Interface Mapping
IDL Interface | Rust Mapping |
---|---|
Attr | Attribute |
CharacterData | CharacterData |
CDATASection | CDataSection |
Comment | Comment |
Document | Document |
DocumentFragment | DocumentFragment |
DocumentType | DocumentType |
DOMImplementation | DOMImplementation |
Element | Element |
Entity | Entity |
EntityReference | EntityReference |
NamedNodeMap | HashMap<Name, RefNode> |
Node | Node |
NodeList | Vec<Rc<RefNode>> |
Notation | Notation |
ProcessingInstruction | ProcessingInstruction |
Text | Text |
Conformance
The has_feature
method on DOMImplementation
and is_supported
on
Node
will return true when the request is for support of the Core or XML
feature and supports both version 1.0 and version 2.0 of Core and version 1.0 of XML.
use xml_dom::level2::{DOMImplementation, get_implementation}; let implementation = get_implementation(); assert!(implementation.has_feature("Core", "1.0")); assert!(implementation.has_feature("Core", "2.0")); assert!(implementation.has_feature("XML", "1.0")); assert!(implementation.has_feature("XML", "2.0"));
Extensions
The following extensions are provided beyond the DOM Level 2 specification, all extensions are in the
level2::ext
module.
- The
get_implementation
function returns an instance ofDOMImplementation
to allow bootstrapping the creation of documents. This satisfies the requirement from the specification: "The DOM Level 2 API does not define a standard way to create DOMImplementation objects; DOM implementations must provide some proprietary way of bootstrapping these DOM interfaces, and then all other objects can be built from there.". - The
get_implementation_version
function in thedom_impl
module returns a vendor-specific version identifier for theDOMImplementation
. - The standard
DOMImplementation
trait also has an additional membercreate_document_with_options
, and associatedProcessingOptions
structure, that can set optional behavior for a givenDocument
instance. - The trait
DocumentDecl
extendsDocument
with the ability to set and retrieve the XML declaration from the document's prolog. - The trait
Namespaced
extendsElement
with the ability to look-up namespace mappings (using the standardxmlns
attribute). - The functions
create_entity
,create_internal_entity
, andcreate_notation
in thedom_impl
module provide the ability to create instances of these Level 2 extended interfaces. In general most clients using the DOM do not need to create these however parsers constructing the DOM may.
Re-exports
pub use dom_impl::get_implementation; |
Modules
convert | Provides safe |
dom_impl | This module implements certain capabilities required by, but not specified by, the DOM Core. |
ext | This module contains extensions above and beyond the Level 2 specification. |
Structs
Name | Corresponds to attributes |
Enums
Error | Corresponds to the DOM |
NodeType | This corresponds to the DOM |
Traits
Attribute | This corresponds to the DOM |
CDataSection | This corresponds to the DOM |
CharacterData | This corresponds to the DOM |
Comment | This corresponds to the DOM |
DOMImplementation | This corresponds to the DOM |
Document | This corresponds to the DOM |
DocumentFragment | This corresponds to the DOM |
DocumentType | This corresponds to the DOM |
Element | This corresponds to the DOM |
Entity | This corresponds to the DOM |
EntityReference | This corresponds to the DOM |
Node | This corresponds to the DOM |
Notation | This corresponds to the DOM |
ProcessingInstruction | This corresponds to the DOM |
Text | This corresponds to the DOM |
Type Definitions
RefNode | Opaque DOM tree node reference. This is the type used by this implementation as the concrete
type for the |
Result | This standard |