pub fn canonicalize(raw: &[u8]) -> Result<Vec<u8>, ShapeViolation>Expand description
Parse + canonicalize per the W3C XML-C14N 1.1 subset documented in
crate::xml. Single recursive-descent pass over raw that emits
the canonical form directly — no fixed buffer, no width/count caps.
Available only under the alloc feature. The model handle
(XmlValue) is no_alloc; canonicalization itself needs heap
storage (per-element attribute sort scratch + the canonical output).
§Errors
- [
INVALID_XML_VIOLATION] (validXml) —rawis not a well-formed UTF-8 document in the supported subset. - [
DEPTH_BOUND_VIOLATION] (depthBound) — nesting exceeds theMAX_XML_DEPTHnative-stack-safety bound.