The first exception to the significant white space rule deals with attribute values.The XML parser uses a set of rules to normalize attribute values.
From a practical perspective, this is a pretty savvy approach on Microsoft’s part.
Most of the time the extra white space is insignificant, and likely a result of pretty printing the XML.
You may also run into I18N as shorthand for internationalization among other W3C standards. The rules for C14N are numerous but not difficult to understand.
In addition to white space rules, attribute ordering, namespace declaration ordering, and character entity reference formats are specified by C14N.
In the figure below, the locations where white space that’s part of the XML syntax may appear are marked with a ( Now when the XML specification says any white space, they don’t really mean it. The standards leave some aspects of white space handling up to the implementers, or at least that’s what the implementers would have us believe.
I suspect some implementers choose to ignore parts of the standards they don’t like or can’t accommodate easily in their toolsets.
If you need to compare two XML documents it would be nice if you could write the XML and its white space in a uniform way so that comparisons can be made more easily with traditional diff tools.
The Canonical XML 1.0 specification provides a set of rules for writing XML documents in a uniform way.
The Exclusive XML Canonicalization specification handles namespace issues surrounding the canonicalization of subsets of XML within other XML documents.