Skip to main content

canonicalize

Function canonicalize 

Source
pub fn canonicalize(xml: &str) -> Result<String, CanonicalizationError>
Expand description

Canonicalize an XML document per RFC 3076 (Canonical XML, no comments).

Steps:

  1. Strip XML declaration (<?xml ... ?>)
  2. Strip processing instructions and comments
  3. Normalize line endings to \n
  4. Normalize attribute value whitespace
  5. Expand character references (& → &, etc.)
  6. Re-encode special characters in text
  7. Encode as UTF-8