Hi,

I tried a simplified update URL with curl:  curl --digest -u 111:111 -T pidf_modify.xml -H "Content-Type: application/xcap-el+xml" -X PUT http://192.168.0.130:5060/xcap-root/pidf-manipulation/users/sip:111@mydomain/index~~/presence/tuple/note

This "correctly" updated the <note/> nodes in both <tuple/> nodes of the document.  So, the problem with the XCAP server appears to be over the %5b@id='x8eg92n'%5d that is used to identify a specific <tuple/> node.  I believe, from searching online, that this is valid XPath syntax, so it does look like there is a bug here.

Any idea?

Thanks,

Peter

On Wed, 2012-04-04 at 17:19 +0100, Peter Dunkley wrote:
Hi,

I have been experimenting with uploading, and modifying existing, XCAP documents.  I have been trying out the example from RFC 4827 and I can't get it to work with Kamailio.

To upload the document (this works) I use the command: curl --digest -u 111:111 -T pidf.xml -X PUT http://192.168.0.130:5060/xcap-root/pidf-manipulation/users/sip:111@mydomain/index

To modify the document (this doesn't work) I use the command: curl --digest -u 111:111 -T pidf_modify.xml -H "Content-Type: application/xcap-el+xml" -X PUT http://192.168.0.130:5060/xcap-root/pidf-manipulation/users/sip:111@mydomain/index~~/presence/tuple%5b@id='x8eg92n'%5d/note

When I try to modify the document I get the error: "Apr  4 17:12:08 pd-laptop-linux kamailio[16862]: ERROR: xcap_server [xcap_server.c:596]: no new content"

I went through the XCAP server code and added some debug and found that the check on xcap_misc.c:491 is succeeding (which means "no selection for xpath parent expression") and the document is not being changed.  Also, from my limited understanding of XPath and libxml2, I would have expected the code path which should have been followed to go through the else clause of the conditional on xcap_misc.c:468 - which means I don't think that the xcaps_xpath_set() function is doing the right thing at all.

Is there anyone here that is more familiar with libxml2 that can give me any pointers here.  As far as I can tell the XCAP server code looks OK to me, and I believe the documents (attached) and my XCAP queries are correct as well.

Thanks,

Peter

_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

-- 
Peter Dunkley
Technical Director
Crocodile RCS Ltd