Canonical XML lets you create a physical representation of an XML document that allows for the variations in XML syntax without changing the meaning. Discover more about this standard method, which is useful for testing and digital signatures, among other things.
Canonical XML Version 1.0 [W3C Recommendation] is a standard method for generating a physical representation of an XML document, called the canonical form, that accounts for the variations allowed in XML syntax without changing meaning. For example, attribute order in XML is insignificant, so if one document has all its attributes sorted in alphabetical order and another is the same except that its attributes are sorted in some different way, then both documents are identical as far as XML 1.0 is concerned, despite the difference in the physical representation. This presents some practical problems. For example, say you want to have a digitally encrypted signature of a document to ensure that it isn't tampered with. A rearrangement of the attributes would break the signature, even though as far as XML standards are concerned, the document has not really changed. The solution is to convert documents to canonical form (a process called "canonicalization (c14n)") before signature, text comparison, or any other such operation. This ensures that changes insignificant in XML will be correctly accommodated. Work has begun on Canonical XML 1.1 [in development], which addresses several important problems with the 1.0 specification.
Sometimes the XML that needs to be compared or signed is actually just a portion of a bigger document. Even then, c14n generally must account for the entire source document in order to handle details such as namespace declarations. If you require c14n to be strictly limited to a document subset, then you must use the related algorithm Exclusive XML Canonicalization Version 1.0 [W3C Recommendation].
- Introducing XML canonical form, by Uche Ogbuji, introduces Canonical XML with examples (developerWorks, December 2004).
- Read about other XML standards: Index of XML standards.
- Participate in any of several XML-centered forums: XML zone discussion forums.
- Get involved in the developerWorks community: developerWorks blogs
- Find out how you can become an IBM-Certified Developer in XML and related technologies at IBM XML certification.
- See the developerWorks XML Zone for a wide range of technical articles and tips, tutorials, standards, and IBM Redbooks at XML technical library.
- Stay current with technology in these sessions: developerWorks technical events and webcasts.
- Build your next development project with trial software available for download directly from developerWorks: IBM trial software