pub fn canonicalize(xml: &str) -> Result<String, CanonicalizationError>Expand description
Canonicalize an XML document per RFC 3076 (Canonical XML, no comments).
Steps:
- Strip XML declaration (
<?xml ... ?>) - Strip processing instructions and comments
- Normalize line endings to \n
- Normalize attribute value whitespace
- Expand character references (& → &, etc.)
- Re-encode special characters in text
- Encode as UTF-8