_ian Posted December 14, 2012 Posted December 14, 2012 This code returns the canonical version of an XML document. import javax.xml.crypto.* import org.apache.xml.security.* import org.apache.xml.security.c14n.* if (inputXML!=null){ org.apache.xml.security.Init.init() def XmlBytes = inputXML.getBytes("UTF-8") as byte[] canon = Canonicalizer.getInstance(Canonicalizer.ALGO_ID_C14N_OMIT_COMMENTS) canonXmlBytes = canon.canonicalize(XmlBytes) canonXmlString = new String(canonXmlBytes) return canonXmlString } Hopefully someone else might find it useful. Ian J
Recommended Posts
This topic is 4631 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now