aster_forge_xml/
lib.rs

1//! Bounded, source-backed XML parsing for Aster services.
2//!
3//! Parsed documents use a flat arena and retain source spans for names, attributes, text, and
4//! subtrees. Values allocate only when XML decoding or configured normalization changes them.
5#![cfg_attr(
6    not(test),
7    deny(
8        clippy::unwrap_used,
9        clippy::unreachable,
10        clippy::expect_used,
11        clippy::panic,
12        clippy::unimplemented,
13        clippy::todo
14    )
15)]
16
17mod document;
18mod error;
19mod parser;
20mod stream;
21mod syntax;
22mod writer;
23
24pub use document::{
25    AttributeRef, Attributes, BorrowedDocument, ChildElements, Children, DescendantElements,
26    ElementRef, NodeId, NodeRef, OwnedDocument, ProcessingInstructionRef, SourceSpan, ValidatedXml,
27    XmlDocument,
28};
29pub use error::{Error, XmlSafetyError};
30pub use parser::{ParseOptions, XmlSafetyPolicy, validate_xml_input, xml_root_local_name};
31pub use stream::{
32    StreamAttribute, StreamAttributes, StreamCData, StreamComment, StreamEnd, StreamName,
33    StreamProcessingInstruction, StreamStart, StreamText, XmlStreamEvent, XmlStreamReader,
34};
35pub use syntax::{is_valid_xml_local_name, is_valid_xml_namespace_name};
36pub use writer::{XmlStreamWriter, XmlWriteAttribute, XmlWriteOptions};
37
38/// The default maximum nesting depth accepted from untrusted XML.
39pub const DEFAULT_XML_MAX_DEPTH: usize = 128;