use thiserror::Error;
#[derive(Debug, Error)]
pub enum XmlError {
#[error("XML parse error: {0}")]
ParseError(#[from] uppsala::XmlError),
#[error("Empty XML document: no root element")]
EmptyDocument,
#[error("Expected an element node")]
NotAnElement,
#[error("Missing required element: {element} in {parent}")]
MissingElement {
parent: String,
element: String,
},
#[error("Missing required attribute: {attribute} on {element}")]
MissingAttribute {
element: String,
attribute: String,
},
#[error("Unexpected element: {0}")]
UnexpectedElement(String),
#[error("Unexpected namespace on {element}: expected {expected}, found {found}")]
UnexpectedNamespace {
element: String,
expected: String,
found: String,
},
#[error("Invalid attribute value for {attribute} on {element}: {value}")]
InvalidAttributeValue {
element: String,
attribute: String,
value: String,
},
#[error("Invalid datetime: {0}")]
InvalidDateTime(String),
#[error("Invalid boolean value: {0}")]
InvalidBoolean(String),
#[error("Invalid integer value: {0}")]
InvalidInteger(String),
#[error("Invalid base64 value: {0}")]
InvalidBase64(String),
#[error("Core validation error: {0}")]
CoreError(#[from] crate::core::CoreError),
#[error("Serialization error: {0}")]
SerializationError(String),
}