[xmlsec] XPointer problem

Aleksey Sanin aleksey at aleksey.com
Tue Mar 11 08:18:44 PST 2003


It seems that digests match because both "xpointer(/1/2)" and 
"xpointer(/1/1/1/1)" return
the same node set with one node. You got it with the following testXPath 
command:

     testXPath.exe --input sig_xpointer_absolute_path_templ.xml --xptr 
xpointer(/1/2)
     Object is a Node Set :
     Set contains 1 nodes:
     1   /

I am not really sure why "/1/1" and "xpointer(/1/1)" return different 
results. I was under
impression that it's exactly the same expression. I need to read 
XPointer/XPath spec
and look in the LibXML code to be able to answer your question. 
Meantime, you can
ask it in the libxml mailing list. It's possible that Daniel knows the 
answer from the top
of his head.

Thanks,
Aleksey


Matthias Jung wrote:

> Aleksey,
>
> thanks a lot for for fixing this problem so fast. I agree that 
> handling such
> expressions now is a good solution and that using XPath expressions is
> better for interoperability reasons. That's exactly the reason why I am
> testing our software even using XPointers :-)
>
> Let's continue this interop discussion when there are more DSig 
> implementations capable of handling xpointer expressions. Xss4j, the 
> only one I had a look at, does
> not support this feature.
>
> Now that this problem is fixed, I found another (last) problem within 
> my test suite. Please have a look at the digest values of the two 
> references in the
> attached signature file, which should not be equal as the references 
> point to different
> elements. It seems that xpointer expressions containing child 
> sequences are
> handled wrong, or something with my expressions is faulty.
>
> I have checked this behaviour using libxml's testXPath executable. The 
> result is:
>
>  testXPath.exe --input sig_xpointer_absolute_path_templ.xml --xptr /1/2
>  Object is a Node Set :
>  Set contains 1 nodes:
>  1  ELEMENT soap-env:Body
>
> (looks good)
>
>  testXPath.exe --input sig_xpointer_absolute_path_templ.xml --xptr 
> xpointer(/1/2)
>  Object is a Node Set :
>  Set contains 1 nodes:
>  1   /
>
> (looks like an empty document)
>
> I have no clue if this is a problem is caused by me, by xmlsec, or 
> libxml.
>
> Thanks a lot for any suggestions,
>
> Matthias






More information about the xmlsec mailing list