Hi,

I've got a number of XAdES files to validate and have error with a
significant number of them:

Xalan Exception : XPathParserException caught.  Message : The prefix 'ds'
is not declared. expression = '/descendant::ds:Signature' Remaining tokens
are:  ('/' 'descendant' '::')



XML looks like this:
<?xml version="1.0" encoding="UTF-8"?><toBeSigned>
toBeSigned
<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#";
Id="signature-9540-6631-2572-8805">
...
<dsig-xpath:XPath xmlns:dsig-xpath="
http://www.w3.org/2002/06/xmldsig-filter2";
Filter="subtract">/descendant::ds:Signature</dsig-xpath:XPath>
...


No error if "ds" namespace is declared in root element, or XPath element.
But given files have "ds" in the middle. Given files are parsed normally
with another library. So I made a small patch to walk through parent
branches (from XPath element) and gather namespace attributes.

This patch is from my company's mercurial repo and is made against 1.7.3
release. Is it useful? Are you interested in it?

Best regards,
Yuri.

Attachment: xml-security-cpp-xpath-resolving.patch
Description: Binary data

Reply via email to