Skip to main content

plugin

Function plugin 

Source
pub fn plugin() -> Plugin
Expand description

The plugin form of xml, for Tabnas::use_plugin. Options are read from the plugin option bag with XmlOptions::from_value; installed this way the grammar is re-applied to derived instances, as every native plugin is.

let mut parser = tabnas_jsonic::make();
parser.use_plugin(tabnas_xml::plugin(), None)?;
assert_eq!(
    parser.parse("<a>&amp;</a>")?.to_string(),
    r#"{"name":"a","localName":"a","attributes":{},"children":["&"]}"#
);