I'm using xml-crypto node.js package to perform Exclusive Canonicalization (http://www.w3.org/2001/10/xml-exc-c14n#) on my XML.
My end result is just slightly malformed:
- Canonicalized XML ends up being wrapped in empty angle brackets, so: <>..myxml..</>
- Canonicalized XML doesn't have correct whitespaces.
I'm attaching a screenshot illustrating the diff between the expected result (red precanonicalized code on the left) and my result (green code on the right) on a part of XML
How to have the end result be the same as the precanonicalized red code on the right? This is how I'm using the lib:
const ExclusiveCanonicalization = require('xml-crypto/lib/exclusive-canonicalization').ExclusiveCanonicalization;
const canonicalization = new ExclusiveCanonicalization();
const canonical = canonicalization.process(xmlRequestDOMDoc).toString()