Validating xml using schema
The rules are specified in the XML specification in section 3.3.3 Attribute-Value Normalization.Here is the gist of the rules: Without getting into what the CDATA type is, by default, with no DTD, attribute values are treated as CDATA, so the last white space collapsing rule above doesn’t apply.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.This isn’t the way white space handling works in Microsoft’s XML tools! The Microsoft XML parser’s white space handling is true to the specification, but by default, their DOM builder aggressively throws out white space.
It neither wholly preserves nor wholly cleans up white space.
XML allows for unbounded white space wherever white space is permitted in the XML syntax.
This is useful for pretty printing an XML document.
The Exclusive XML Canonicalization specification handles namespace issues surrounding the canonicalization of subsets of XML within other XML documents.
In many messaging scenarios, it’s desirable to have your message payload independent of the rest of the layers of the SOAP stack. Be mindful of Microsoft’s default white space handling if you’re going to interoperate with non-Microsoft C14N implementations.