pub struct ReadOptions {
pub empty_text_node: bool,
pub trim_text: bool,
pub ignore_whitespace_only: bool,
pub require_decl: bool,
pub encoding: Option<String>,
pub enforce_encoding: bool,
}Expand description
Options when parsing xml.
Fields§
§empty_text_node: booltrue
trim_text: boolTrims leading and ending whitespaces in Node::Text, and ignore node if it is empty.
Default: true
ignore_whitespace_only: boolIgnore Node::Text that only has whitespaces.
Only makes sense if trim_text is false. (If both are true, performance takes a hit for no gain)
Default: false
require_decl: boolReturns error if document doesn’t start with XML declaration.
If there is no XML declaration, the parser won’t be able to decode encodings other than UTF-8, unless encoding below is set.
Default: true
encoding: Option<String>If this is set, the parser will start reading with this encoding.
If enforce_encoding is set to false, the parser will then switch to XML declaration’s
encoding value if it has a different value.
See Encoding::for_label for valid values.
Default: None
enforce_encoding: boolIf set to true, the parser will fail with Error::CannotDecode in case encoding
is specified and the declared encoding of the XML document is different.
The parser will always fail if this is set to true, but no encoding is specified.
Default: false
Trait Implementations§
Source§impl Clone for ReadOptions
impl Clone for ReadOptions
Source§fn clone(&self) -> ReadOptions
fn clone(&self) -> ReadOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more