pub struct XmlOptions {
pub namespaces: bool,
pub entities: bool,
pub custom_entities: IndexMap<String, String>,
pub strict_entities: bool,
pub strict_namespaces: bool,
pub embed: bool,
}Expand description
Plugin options. Default is the canonical default set: namespaces
resolved, entities decoded, no custom entities, undeclared entities an
error, unbound prefixes accepted, pure-XML mode.
Fields§
§namespaces: boolResolve namespaces: annotate elements with prefix, localName
and namespace. Default: true.
entities: boolDecode the five predefined entities and numeric character references in character data. Default: true.
custom_entities: IndexMap<String, String>Additional named entities beyond the five predefined ones.
strict_entities: boolEnforce XML 1.0 4.1: every named entity reference must resolve to
a declared entity (predefined, custom, or a DOCTYPE <!ENTITY>
declaration). Default: true. When off, a reference to an unknown
name is left as it is in the output.
strict_namespaces: boolEnforce the Namespaces in XML 1.0 rule that every prefix on an
element or attribute name be bound by an in-scope xmlns:prefix
declaration. Default: false. XML 1.0 well-formedness and
Namespaces in XML are separate specifications: <a><foo:b/></a>
is well-formed XML, merely not namespace-well-formed, so an
unbound prefix is reported only when this is on. Either way the
element keeps its prefix and localName; an unbound prefix
leaves namespace unset.
embed: boolEmbed mode. When false (the default) the parser is configured for
pure-XML input: xml becomes the start rule, the JSON structural
tokens are dropped and every non-XML lexer is switched off. When
true the jsonic grammar stays in place and an alternate is added
to its val rule so a literal element (<tag>...</tag> or
<tag/>) appears wherever jsonic expects a value.
Implementations§
Source§impl XmlOptions
impl XmlOptions
Sourcepub fn from_value(value: &Value) -> Self
pub fn from_value(value: &Value) -> Self
Read an option bag the way ts/src/xml.ts reads it: each field on
its own terms (namespaces !== false, embed === true, and so
on), so one field of the wrong type leaves only that field at its
default. The bag is the JSON shape a fixture’s opts column
carries and the shape plugin receives.
Trait Implementations§
Source§impl Clone for XmlOptions
impl Clone for XmlOptions
Source§impl Debug for XmlOptions
impl Debug for XmlOptions
Source§impl Default for XmlOptions
impl Default for XmlOptions
impl Eq for XmlOptions
Source§impl PartialEq for XmlOptions
impl PartialEq for XmlOptions
impl StructuralPartialEq for XmlOptions
Auto Trait Implementations§
impl Freeze for XmlOptions
impl RefUnwindSafe for XmlOptions
impl Send for XmlOptions
impl Sync for XmlOptions
impl Unpin for XmlOptions
impl UnsafeUnpin for XmlOptions
impl UnwindSafe for XmlOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.