use crate::ns::*; use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize)] pub struct XmlExpression { pub location: Location, pub element: Rc, } #[derive(Debug, Clone, Serialize, Deserialize)] pub struct XmlMarkupExpression { pub location: Location, pub markup: String, } #[derive(Debug, Clone, Serialize, Deserialize)] pub struct XmlListExpression { pub location: Location, pub content: Vec>, } #[derive(Debug, Clone, Serialize, Deserialize)] pub struct XmlElement { pub location: Location, pub name: XmlTagName, pub attributes: Vec>, pub attribute_expression: Option>, pub content: Option>>, pub closing_name: Option, } #[derive(Debug, Clone, Serialize, Deserialize)] pub enum XmlTagName { Name((String, Location)), Expression(Rc), } #[derive(Debug, Clone, Serialize, Deserialize)] pub struct XmlAttribute { pub location: Location, pub name: (String, Location), pub value: XmlAttributeValue, } #[derive(Debug, Clone, Serialize, Deserialize)] pub enum XmlAttributeValue { Value((String, Location)), Expression(Rc), } #[derive(Debug, Clone, Serialize, Deserialize)] pub enum XmlContent { Characters((String, Location)), Markup((String, Location)), Element(Rc), Expression(Rc), }