[SR-Users] presence_xml and xpath

Andreas Granig agranig at sipwise.com
Mon Dec 6 15:13:06 CET 2010


Hi,

I'm having troubles fetching an xpath from an xml document using
presence_xml, so I probably do something wrong (using kamailio 3.0.x):

$xml(x=>doc) = '<?xml version="1.0" encoding="utf-8"?><presence
xmlns="urn:ietf:params:xml:ns:pidf"
entity="sip:test at mydomain.com"><tuple
id="86ae65b7-42de-4399-b635-295caad13aac"><status><basic>none</basic></status></tuple></presence>';

xlog("L_INFO", "all=$xml(x=>doc)\n");

 -> prints the whole document, which is ok

xlog("L_INFO", "tmp1=$xml(x=>xpath:/)\n");

  -> also prints the whole document (including the xml tag in the
beginning, not sure if this is ok)

xlog("L_INFO", "tmp2=$xml(x=>xpath:/presence)\n");

  -> prints an empty string

How is this actually supposed to work? What I'd like to do in the end is
extracting for example the "none" from the "basic"-tag by specifying
"xpath:/presence/tuple/status/basic", which also returns an empty string
now, also when appended with "/text()".

Thanks a lot,
Andreas

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 900 bytes
Desc: OpenPGP digital signature
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20101206/c6635f44/attachment.pgp>


More information about the sr-users mailing list