All,

In the Java Library, I observe a couple of things whose combined result seems to be erroneous.

Consider the following example document -
<foo>text1
text2</foo>
Also assume that the dom representation of this document as - A DOM element named "foo" having two child text nodes - "text1" and "\ntext2".


1. In XMLSignatureInput, method getNodeSet() delegates the task of forming the resultant node-set to XMLUtils.getSetWith*Comments(). This method populates the node-set with both the text nodes.

2. When this node-set is sent for exclusive canonicalization, the method CanonicalizerBase.canonicalizeXPathNodeSet(Node, NameSpaceSymbTable) comes into picture. In the switch block of this method, for the TEXT_NODE case, the text node as well all its right hand side siblings are written to the output stream. Hence, for the above example, the c14n output would come out to be:

<foo>text1
text2
text2</foo>

I am not sending a testcase along but that shouldn't be difficult to write. Comments?

Regards,
Vishal



Reply via email to