[][src]Function xml_dom::get_implementation

pub fn get_implementation() -> &'static dyn DOMImplementation<NodeRef = RefNode>

Return a reference to an instance of this DOMImplementation implementation.

This function gets around the DOM bootstrap issue, the implementation method on the Document trait requires an instance of Document; however, the create_document method on DOMImplementation requires an instance from implementation.

Example

use xml_dom::get_implementation;

let implementation = get_implementation();
let mut document_node = implementation
    .create_document("http://www.w3.org/1999/xhtml", "html", None)
    .unwrap();