Question

I'm using org.apache.xml.security.c14n.Canonicalizer which was recommended to me here: Sort xml attributes for pretty print using javax.xml.transform.Transformer. I will need it to run in Java 5 though.. it doesn't seem to work.

Are there any options?

Was it helpful?

Solution

XOM has a Canonicalizer which will do this.

In addition to being a very good general-purpose XML DOM library, it's a much more lightweight solution to canonicalization than your XSLT-based solution.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top