Canonical XML

XBinder can help you create documents that follow the W3C Canonical XML Recommendation. XBinder for C and C++ have a -c14n command line option for this purpose. For Java and C#, however, you programmatically turn on Canonical XML support by invoking the method setCanonicalXML() on your XBXmlEncoder object.

Turning on Canonical XML support has the following effects:

Additionally, you must take some care to comply with the Canonical XML recommendation. You must use UTF-8 character encoding (the zero argument constructor for XBXmlEncoder does this). You must not add superfluous namespaces into your complex-type objects. Finally, for mixed content and xml:any types (where you provide raw XML that passes directly into the output), you must ensure that the raw XML you provide complies with the Canonical XML recommendation.