santuario-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 42986] The </#document> node inserted at the end of SOAPEnvelop
Date Wed, 03 Jun 2009 13:56:27 GMT

--- Comment #4 from coheigea <>  2009-06-03 06:56:24 PST ---
Created an attachment (id=23749)
 --> (
A patch for this issue.

I debugged through this test-case and have come up with a patch.

The reason there's a problem with the Oracle DOM implementation is that the
Document implementation seems to also implement the Element interface, and so
the line:

if (!(parentNode instanceof Element)) {

in CanonicalizerBase doesn't get executed, even though "parentNode" is a
document node, and hence the extra content "</#document>" gets outputted.

The good news is that this can be easily fixed by examining the Node type of
parentNode rather than using reflection, i.e.:

if (parentNode == null || Node.ELEMENT_NODE != parentNode.getNodeType()) {

as the Node in question is a Document node, even if confusingly it's also an
instanceof Element. 

I've confirmed that this fix works fine with the Oracle DOM implementation. The
patch also replaces any other call to instanceof Element/Document in
XML-Security - we should avoid using reflection when a simple API call will
suffice for performance reasons.


Configure bugmail:
------- You are receiving this mail because: -------
You are the assignee for the bug.

View raw message