use crate::ns::*; use serde::{Serialize, Deserialize}; use std::rc::Rc; #[derive(Clone, Serialize, Deserialize)] pub struct XmlExpression { pub location: Location, pub element: Rc, } #[derive(Clone, Serialize, Deserialize)] pub struct XmlMarkupExpression { pub location: Location, pub markup: String, } #[derive(Clone, Serialize, Deserialize)] pub struct XmlListExpression { pub location: Location, pub content: Vec>, } #[derive(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(Clone, Serialize, Deserialize)] pub enum XmlTagName { Name((String, Location)), Expression(Rc), } #[derive(Clone, Serialize, Deserialize)] pub struct XmlAttribute { pub location: Location, pub name: (String, Location), pub value: XmlAttributeValue, } #[derive(Clone, Serialize, Deserialize)] pub enum XmlAttributeValue { Value((String, Location)), Expression(Rc), } #[derive(Clone, Serialize, Deserialize)] pub enum XmlElementContent { XmlText((String, Location)), XmlMarkup((String, Location)), XmlElement(Rc), Expression(Rc), }