pub struct ProcessingOptions(_);
Expand description

This type encapsulates a set of options that a client can set that affect the processing of nodes as they are added/removed from the DOM. The default for ProcessingOptions is that none of the options are set, if the usual DOMImplementation::create_document method turns on any settings these are not set by default by create_document_with_options.

This type has a set of methods that turn on options, i.e. set_assume_ids, and retrieve the state of an option, i.e. has_assume_ids.

Example

The following will set an option to relax the rules on ID handling. By default the processor will treat all attributes with the prefix and local name xml:id or local name id and the namespace http://www.w3.org/XML/1998/namespace as IDs. With this option set all all attributes with the local name id regardless of prefix or namespace will be treated as an ID.

use xml_dom::level2::*;
use xml_dom::level2::convert::*;
use xml_dom::level2::ext::*;
use xml_dom::level2::ext::dom_impl::get_implementation_ext;

let mut options = ProcessingOptions::new();
options.set_assume_ids();

let implementation = get_implementation_ext();
let mut document_node = implementation
    .create_document_with_options(
        Some("http://www.w3.org/1999/xhtml"),
        Some("html"),
        None,
        options)
    .unwrap();

Implementations

Construct a new ProcessingOptions instance with all options off.

Returns true if all options are false.

Returns true if the document will automatically assume certain attributes will be treated as XML id values, else false.

Returns true if the document will parse entities inside text nodes and create EntityReference nodes, else false.

Returns true if the document will automatically add namespace attributes to elements if qualified names are added that do not have current mappings., else false.

TBD.

Note: if an attribute with the qualified name xml:id, and the namespace is set to the XML namespace http://www.w3.org/XML/1998/namespace then the value is known to be an ID.

See xml:id Version 1.0, §4 Processing xml:id Attributes for more details.

TBD

TBD

Trait Implementations

Formats the value using the given formatter.

The resulting type after applying the & operator.

Performs the & operation. Read more

The resulting type after applying the | operator.

Performs the | operation. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.