1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
//! **`uor_addr::xml` — the XML realization of UOR-ADDR**
//! (ARCHITECTURE.md "Format-specific realizations" § `uor-addr-xml`).
//!
//! XML typed-input content-addressing under a **subset** of
//! W3C Canonical XML 1.1 (XML-C14N 1.1), with the σ-projection bound
//! to `prism::crypto::Sha256Hasher`.
//!
//! ## Authoritative sources
//!
//! - **W3C Canonical XML Version 1.1** — Recommendation 2 May 2008
//! (<https://www.w3.org/TR/xml-c14n11/>).
//! - **W3C XML 1.0 (Fifth Edition)** — base syntax
//! (<https://www.w3.org/TR/xml/>).
//! - **SHA-256 σ-projection** — NIST FIPS 180-4
//! (<https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf>).
//!
//! ## Supported canonical-XML subset
//!
//! Per ARCHITECTURE.md the typed-input shape `XmlValue` is a
//! `partition_coproduct!` over five XML grammar cases (Element,
//! Attribute, Text, CDATA, ProcessingInstruction). The shipped
//! conformance subset implements the rules in XML-C14N 1.1 §1.1 that
//! apply to structurally-typed XML — without external entities,
//! DTDs, or namespace-prefix manipulation, which are out of scope
//! for typed content-addressing:
//!
//! 1. Elements are emitted as `<name>...</name>` with no namespace
//! prefixes (the typed input shape does not carry namespace
//! qualification).
//! 2. Attributes are emitted in **lexicographic byte order** by
//! attribute name per XML-C14N 1.1 §1.1 rule 3.
//! 3. Attribute values are double-quoted; the value bytes are
//! character-escaped per XML-C14N 1.1 §1.1 rule 4 (`<` → `<`,
//! `>` → `>`, `&` → `&`, `"` → `"`, `\t` → `	`,
//! `\n` → `
`, `\r` → `
`).
//! 4. Text content is character-escaped per the C14N 1.1 §1.1 rule 5
//! (`<` → `<`, `>` → `>`, `&` → `&`, `\r` → `
`).
//! 5. CDATA sections are expanded to text content before
//! canonicalization (XML-C14N 1.1 §1.1 — CDATA is informationally
//! equivalent to escaped text).
//! 6. Processing instructions are emitted as `<?target data?>`.
//!
//! ## Out-of-scope rules (documented deviations)
//!
//! The shipped canonicalizer does **not** handle: namespace prefix
//! rewriting (we don't admit namespaced input), DTD-internal entity
//! resolution (we don't admit DTDs), `xml:` reserved attributes
//! beyond the structural typing the parser enforces, and document
//! whitespace outside element content (we admit only element
//! content). These rules apply to deserialization from arbitrary XML
//! 1.0 documents — out of scope for the typed-input pipeline.
//! Conformance tests pin the supported subset; the deviation is
//! documented in [STANDARDS.md](https://github.com/UOR-Foundation/uor-addr/blob/main/STANDARDS.md).
pub use ;
pub use ;
pub use ;
pub use MAX_XML_DEPTH;
pub use canonicalize;
pub use XmlValue;
pub use ;
/// The shared, format-independent ψ-tower (re-exported for convenience;
/// canonical path is [`crate::resolvers::AddressResolverTuple`]).
pub use crateAddressResolverTuple;