xml-sec 0.2.0

Pure Rust XML Security: XMLDSig, XMLEnc, C14N. Drop-in replacement for libxmlsec1.
Documentation
#![deny(unsafe_code)]
#![forbid(clippy::unwrap_used)]
//! A parser-independent XSLT 1.0 compiler and execution engine.
//!
//! Compilation and execution are separate: [`Compiler`] produces an immutable
//! [`Stylesheet`] which can be shared between threads and applied repeatedly.
//! The crate performs no implicit filesystem, network, or environment access.
//! Principal and resolver-provided XML bytes honor declarations, BOMs, UTF-16
//! initial patterns, and explicit encoding metadata through [`Document::parse_bytes`]
//! and [`Compiler::compile_bytes`]. Untrusted source documents use
//! [`Document::parse_with_budget`] or [`Document::parse_bytes_with_budget`] so decoded bytes,
//! arena nodes, element depth, entity-reference count and expansion bytes, and namespace-scope
//! storage are rejected before their corresponding work or allocations.
//!
//! ```
//! # #[cfg(not(feature = "embedded"))]
//! # {
//! use std::sync::Arc;
//! use xml_sec_xslt::{CompileBudget, Compiler, NoResolver};
//!
//! let stylesheet = Compiler::new(
//!     Arc::new(NoResolver),
//!     CompileBudget::new(64 * 1024, 0, 128, 256 * 1024),
//! ).compile(
//!     r#"<xsl:stylesheet version="1.0"
//!          xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
//!          <xsl:template match="/"><result/></xsl:template>
//!        </xsl:stylesheet>"#,
//!     None,
//! ).expect("stylesheet compiles");
//! assert_eq!(stylesheet.resource_identities(), []);
//! # }
//! ```

mod budget;
mod compiler;
mod environment;
mod error;
mod expression;
mod exslt_date;
mod lexical;
mod model;
mod resolver;
mod runtime;
mod serializer;
mod value;
mod xpath;

pub use budget::{
    BudgetKind, CompileBudget, ExecutionBudget, ExecutionUsage, ParseBudget, ParseUsage, Reported,
};
pub use compiler::{Compiler, Stylesheet, UnboundPrefixLists};
pub use environment::{Clock, ExecutionEnvironment, FixedClock, SystemClock};
pub use error::{Error, ErrorKind, Result};
pub use model::{
    Attribute, Document, ExpandedName, Namespace, Node, NodeId, NodeKind, NodeReference,
};
pub use resolver::{
    AccessDenialReason, NoResolver, ResolvePurpose, ResolveRequest, ResolvedResource, Resolver,
    ResourceAccess, ResourceIdentity,
};
pub use runtime::{ExecutionOptions, Message, Parameters, SecondaryOutput, TransformResult};
pub use serializer::{OutputDefinition, OutputMethod, SerializedOutput};
pub use value::Value;