1mod parser;
7mod printer;
8
9pub use parser::{parse_file, parse_str, XmlParser};
10pub use printer::{print_to_string, print_to_string_pretty, XmlPrinter, XmlPrinterOptions};
11
12use crate::node::{NodeRef, XmlContent};
13
14pub trait NodeFactory {
19 fn make_node(&self, content: XmlContent) -> NodeRef;
21}
22
23pub struct BaseNodeFactory;
25
26impl NodeFactory for BaseNodeFactory {
27 fn make_node(&self, content: XmlContent) -> NodeRef {
28 crate::node::new_base_node(Some(content))
29 }
30}
31
32pub struct BranchNodeFactory;
34
35impl NodeFactory for BranchNodeFactory {
36 fn make_node(&self, content: XmlContent) -> NodeRef {
37 crate::node::new_branch_node(Some(content))
38 }
39}