[xmlsec] XPointer problem

Aleksey Sanin aleksey at aleksey.com
Mon Mar 10 08:09:23 PST 2003


Matthias,

The fix for this problem is trivial (see attached file). I've checked it in
both XMLSEC_0_0_X_BRANCH and the tip. However, it'll require
a minor change on your side as well. You need to remove one "xpointer"
as follows:

<Reference
URI="#xmlns(soap-env=http://schemas.xmlsoap.org/soap/envelope/)xpointer(/soap-env:Envelope/soap-env:Body)">

I am absolutelly not sure that this will be interoperable with other XML 
DSig
toolkits but it seems logical to me. For example, compare the reference
URI above with this one:

<Reference URI="#xpointer(/Envelope/Body)">

Another way to achieve the same goal is to use empty URI ("") and an
XPath transform that will look similar to the XPointer expression you are
using now. I doubt that there will be any visible performance penalty.
And IMHO, XPath transform is better solution because of possible interop
issues I mentioned above.


Thanks for reporting this problem! And you are not bothering me at all :)

Aleksey

-------------- next part --------------
Index: src/transforms.c
===================================================================
RCS file: /cvs/gnome/xmlsec/src/transforms.c,v
retrieving revision 1.12.4.3
diff -u -r1.12.4.3 transforms.c
--- src/transforms.c	21 Feb 2003 21:05:28 -0000	1.12.4.3
+++ src/transforms.c	10 Mar 2003 16:12:32 -0000
@@ -1152,7 +1152,7 @@
 	    }
 	    
 	    /* evaluate expression but skip '#' */
-	    if(strncmp(xptr, "#xpointer(", 10) == 0) {
+	    if((strncmp(xptr, "#xpointer(", 10) == 0) || (strncmp(xptr, "#xmlns(", 7) == 0)) {
 		type = xmlSecNodeSetTree;
 		res = xmlXPtrEval(BAD_CAST (xptr + 1), ctxt);
 	    } else {


More information about the xmlsec mailing list