[SR-Users] XMLOPS xpath issues

Olle E. Johansson oej at edvina.net
Mon Feb 27 20:50:43 CET 2012


Friends,
I'm having issues with the xpath support. If I run Daniel's example in the XMLOPS, xpath works as documented. But if I take the
body of a PUBLISH from the and run xpath, I don't get expected results. Now, I'm no XPATH guru so I may be totally off the markup here...

Here's the test script:

$xml(pub=>doc) = $rb;
        $var(contact)=$xml(pub=>xpath:registration/contact at event);
        xlog("--- Publish contact $var(contact) \n");
        xlog("--- Publish aor $xml(pub=>xpath:registration at aor) \n");
        xlog("--- Publish aor: $xml(pub=>xpath://@aor) \n");
        xlog("--- Publish reg state:  $xml(pub=>xpath://reginfo@state) \n");
        xlog("--- Publish uri:  $xml(pub=>xpath:contact/uri/text()) \n");

I've tested with various paths, orginating from /reginfo or just picking an attribute. 

Here's the XML from Carsten's PUA_REGINFO module:

<?xml version="1.0"?>
<reginfo xmlns="urn:ietf:params:xml:ns:reginfo" version="0" state="full">
  <registration aor="sip:oej at testnamn.se" id="0x80590a590" state="terminated"/>
</reginfo>

I wonder if it's something with using the request body that doesn't parse properly in the XMLOPS module?

Error messages are a series of "XPath error : Invalid expression" 

/O


More information about the sr-users mailing list