zparse/xml/model.rs
1//! XML data model
2
3use indexmap::IndexMap;
4
5/// XML document
6#[derive(Clone, Debug, PartialEq)]
7pub struct Document {
8 pub root: Element,
9}
10
11/// XML element
12#[derive(Clone, Debug, PartialEq)]
13pub struct Element {
14 pub name: String,
15 pub attributes: IndexMap<String, String>,
16 pub children: Vec<Content>,
17}
18
19/// XML content node
20#[derive(Clone, Debug, PartialEq)]
21pub enum Content {
22 Element(Element),
23 Text(String),
24}