Hi,

Working with the class RetrievalMethodResolver I got some problems,
mainly when the retrieved content was transformed using an XPath
Transformer. 
For example using a "http://www.w3.org/TR/1999/REC-xpath-19991116";
transformer, if the query returned more than one node the code converted
the result into a byte[]and tried to parse it again.
That resulted in a fail, because the parser cannot parse the resulting
structure. It also made an unnecessary reparsing of the retrieved nodes
that caused an extra overhead.

To reproduce this error you can try to parse the signature provided
inside data/org/apache/xml/security/temp/key/retrieval-from-same-doc.xml
of the current release.
When executing the xpath transformation
(ancestor::my:[EMAIL PROTECTED]"thecert"]) 2 nodes where retrieved and
when the method tried to parse the result to get a KeyInfo (or child)
node an error was raised.

I made a refactor of the code supporting this case and eliminating the
need of reparse the xpath resulting set if the XmlSignatureInput
contains a node (or nodeSet).

I don't know how to contribute it so I post it to you, hoping that this
will be useful to someone ;).

Regards

Dave Garcia

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to