[XML Security Suite]

XML Canonicalizer

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].


Sample programs

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.xml
E:\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

Changes

2001.8.31
Exclusive C14n implmentation.
c14n.C14nDOM and SerializeSubset support Exclusive C14n.
2001.4.19
Switched to Xalan2
Conforming to REC-xml-c14n-20010315
C14nDOM: Changed default algorithm, and add -old option.
2000.11.30
Fixed a bug of attribute sorting
Conforming to CR-xml-c14n-20001026
2000.10.18
Conforming to WD-xml-c14n-20001011
2000.7.21
Supported XPath-based C14n.
Added SerializeSubset.
2000.4.5
Fixed a bug of attribute sorting.


TAMURA, Kent
$Id: c14n.html,v 1.9 2002/04/22 03:48:45 kent Exp $