Skip to main content

Crate libxml_rs

Crate libxml_rs 

Source
Expand description

libxml-rs: Custodial native-Rust reimplementation of libxml2 and libxslt

This is not an XML crate. This is not an XSLT crate. This is not a wrapper. This is a forensic reconstruction of the observable behavior of the libxml2 + libxslt ecosystem across its historical lifetime, implemented in native Rust.

§Architecture

The crate is organized into semantic modules corresponding to real ownership boundaries:

  • abi - C ABI compatibility layer: types, structs, constants, exports, callbacks, allocator, ownership, versioning
  • xml - libxml2 implementation: parser, SAX, tree, entities, namespaces, DTD, validation, reader, writer, encoding, I/O, catalog, URI, XPath, XPointer, XInclude, RELAX NG, schemas, Schematron, C14N, HTML, regex, automata, dictionary, hash, list, debug, globals, threads, errors, memory
  • xslt - libxslt implementation: stylesheet, compiler, transform, templates, patterns, variables, parameters, keys, attributes, namespace_alias, whitespace, sorting, numbering, documents, imports, extensions, serialization, security, errors
  • exslt - EXSLT modules: common, math, sets, strings, dynamic, functions, dates
  • compatibility - Historical profiles, quirks, platform-specific behavior
  • bin - CLI tools: xmllint, xmlcatalog, xsltproc

§Safety

This crate uses unsafe only where fundamentally required for C ABI export, raw-pointer compatibility, foreign allocator interoperability, public C structure layout, callbacks, variadic compatibility, OS interfaces, and dynamic-loader interaction.

Every unsafe block documents:

  • What must be true
  • Who establishes it
  • How long it remains true
  • Which oracle/parity court exercises the assumption
  • What would constitute violation

Modules§

abi
C ABI compatibility layer (§4, §14).
compatibility
Compatibility profiles, historical behavior, and platform quirks (§68, §69).
exslt
EXSLT implementation — native Rust (§35).
xml
libxml2 implementation — native Rust (§1, §3, §31).
xslt
libxslt implementation — native Rust (§1, §3, §31–§34).

Constants§

LIBXML_RS_VERSION
The full version string of the libxml-rs crate (from Cargo.toml).
LIBXML_RS_VERSION_MAJOR
Major version number of libxml-rs.
LIBXML_RS_VERSION_MICRO
Micro version (patch) number of libxml-rs.
LIBXML_RS_VERSION_MINOR
Minor version number of libxml-rs.