A Rust crate providing a reasonably faithful implementation of the W3C Document Object Model Core, Level 2.
This crate provides a trait-based implementation of the DOM with minimal changes to the style and semantics defined in the Level 2 specification. The specific mapping from the IDL in the specification is described in the documentation, however from a purely style point of view the implementation has the following characteristics:
_data
, _node
) have been reduced for brevity/clarity.xml_dom::convert
module.```rust use xmldom::*; use xmldom::convert::*;
let implementation = getimplementation(); let mut documentnode = implementation.create_document("uri:urn:simons:thing:1", "root", None).unwrap();
let document = asdocument(&documentnode).unwrap(); let root = document.create_element("root").unwrap();
let mut rootnode = documentnode.appendchild(root).unwrap(); let root = aselementmut(&mut rootnode).unwrap(); root.setattribute("version", "1.0"); root.setattribute("something", "else");
let xml = documentnode.tostring(); println!("document 2: {}", xml); ```
Version 0.1.0
DocumentFragment
, Entity
, EntityReference
, or Notation
.Document::get_element_by_id
always returns None
.unimplemented!()
.quick_xml
.