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
sourceimpl ProcessingOptions
impl ProcessingOptions
sourcepub fn has_assume_ids(&self) -> bool
pub fn has_assume_ids(&self) -> bool
Returns true
if the document will automatically assume certain attributes will be treated
as XML id
values, else false
.
sourcepub fn has_parse_entities(&self) -> bool
pub fn has_parse_entities(&self) -> bool
Returns true
if the document will parse entities inside text nodes and create
EntityReference
nodes, else false
.
sourcepub fn has_add_namespaces(&self) -> bool
pub fn has_add_namespaces(&self) -> bool
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
.
sourcepub fn set_assume_ids(&mut self)
pub fn set_assume_ids(&mut self)
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.
sourcepub fn set_parse_entities(&mut self)
pub fn set_parse_entities(&mut self)
TBD
sourcepub fn set_add_namespaces(&mut self)
pub fn set_add_namespaces(&mut self)
TBD
Trait Implementations
sourceimpl Binary for ProcessingOptions
impl Binary for ProcessingOptions
sourceimpl BitAnd<ProcessingOptions> for ProcessingOptions
impl BitAnd<ProcessingOptions> for ProcessingOptions
sourceimpl BitOr<ProcessingOptions> for ProcessingOptions
impl BitOr<ProcessingOptions> for ProcessingOptions
sourceimpl Clone for ProcessingOptions
impl Clone for ProcessingOptions
sourcefn clone(&self) -> ProcessingOptions
fn clone(&self) -> ProcessingOptions
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ProcessingOptions
impl Debug for ProcessingOptions
sourceimpl Default for ProcessingOptions
impl Default for ProcessingOptions
sourceimpl Display for ProcessingOptions
impl Display for ProcessingOptions
sourceimpl PartialEq<ProcessingOptions> for ProcessingOptions
impl PartialEq<ProcessingOptions> for ProcessingOptions
sourcefn eq(&self, other: &ProcessingOptions) -> bool
fn eq(&self, other: &ProcessingOptions) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &ProcessingOptions) -> bool
fn ne(&self, other: &ProcessingOptions) -> bool
This method tests for !=
.
impl Eq for ProcessingOptions
impl StructuralEq for ProcessingOptions
impl StructuralPartialEq for ProcessingOptions
Auto Trait Implementations
impl RefUnwindSafe for ProcessingOptions
impl Send for ProcessingOptions
impl Sync for ProcessingOptions
impl Unpin for ProcessingOptions
impl UnwindSafe for ProcessingOptions
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more