![[XML Security Suite]](xmlsec.gif)
The XML Security Suite has classes that canonicalize XML documents. They are based on Canonical XML [19-January-2000], Canonical XML [W3C REC, 15-Mar-20001] and Exclusive XML Canonicalization [W3C CR, 12-February-2002].
c14n.C14nDOM and c14n.C14nSAX canonicalize an XML document from the stardard input, and output to the standard output.
E:\xss4j\samples> java c14n.C14nDOM -old < foo.xml > foo-canonicalized.xmlE:\xss4j\samples> java c14n.C14nSAX < foo.xml > foo-canonicalized.xml
These programs support [19-January-2000] Canonical XML. c14n.C14nDOM has the "-xpath" option that enables [15-Mar-2001] canonicalization.
E:\xss4j\samples> java c14n.C14nDOM -xpath < foo.xml > foo-canonicalized.xml
c14n.C14nDOM has the "-exclusive" option that enable Exclusive XML Canonicalization.
E:\xss4j\samples> java c14n.C14nDOM -exclusive < foo.xml > foo-canonicalized.xml
c14n.SerialzeSubset is a sample program for canonicalization against Document Subsets. Add xalan.jar of Xalan-2.3 to CLASSPATH, and type as follows:
E:\xss4j\samples> java c14n.SerializeSubset xpath-expression < foo.xml > foo-canonicalized.xml
| Note: You would not get the same result if you used the above expression for XPath filtering of XML-Signature |
For Exclusive C14n, specify `-eprefix-list'.
E:\xss4j\samples> java c14n.SerializeSubset -edsig,xhtml xpath-expression < foo.xml > foo-canonicalized.xml
c14n.C14nDOM and SerializeSubset support Exclusive C14n.