[SR-Users] escape firt two lines from get_body_part to get xml only part

Artur Hovsepyan hvspa at yahoo.com
Wed Apr 6 16:02:31 CEST 2022


I am trying different variants, but no luck:

xinfo("status: $xml(x=>xpath:/pidf:presence/pidf:dm:device/pidf:gp:geopriv/pidf:gp:location-info/pidf:gs:Circle/pidf:gml:pos)\n");
xinfo("GML_LOC: $xml(x=>xpath:/pidf:presence/pidf:dm\:device/pidf:gp\:geopriv/pidf:gp\:location-info/pidf:gs\:Circle/pidf:gml\:pos)\n");
xinfo("GML_LOC: $xml(x=>xpath:/pidf:presence/dm:device/gp:geopriv/gp:location-info/gs:Circle/gml:pos)\n");


    On Wednesday, April 6, 2022, 09:45:24 AM EDT, Artur Hovsepyan <hvspa at yahoo.com> wrote:  
 
 hi Daniel,i have also tried to access like this, but still no luck:
xinfo("status: $xml(x=>xpath:/pidf:presence/pidf:dm:device/pidf:gp:geopriv/pidf:gp:location-info/pidf:Circle/pidf:gml:pos)\n");
so i am not sure how do i access the gml_loc correctly. will appreciate if you give me an example of similar XML so i can use to get what i want to get.
thanks

 

    On Wednesday, April 6, 2022, 04:40:56 AM EDT, Daniel-Constantin Mierla <miconda at gmail.com> wrote:  
 
  
It doesn't seem that element gml:pos is the root node, so the path to it has to contain the parent tags. See the xpath specs to understand betther how it has to be constructed.
 
Cheers,
 Daniel
     
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20220406/b751f8a1/attachment.htm>


More information about the sr-users mailing list