<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>iirc, to get the text between tags, you have to use text()
      function of xpath (should be in the xpath specs) -- I guess you
      have to use:</p>
    <p>$xml(x=>xpath:/pidf:presence/dm:device/gp:geopriv/gp:location-info/gs:Circle/gml:pos/text())</p>
    <p>Cheers,<br>
      Daniel<br>
    </p>
    <div class="moz-cite-prefix">On 06.04.22 18:13, Artur Hovsepyan
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:1148004886.273626.1649261589236@mail.yahoo.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div class="yahoo-style-wrap" style="font-family:Helvetica Neue,
        Helvetica, Arial, sans-serif;font-size:16px;">
        <div dir="ltr" data-setdir="false">good evening everyone,</div>
        <div dir="ltr" data-setdir="false"><br>
        </div>
        <div dir="ltr" data-setdir="false">can you please help how to
          parse following XML body and get the "<span><gml:pos>31.204359
            -44.512358</gml:pos></span>" in a variable? <br>
        </div>
        <div dir="ltr" data-setdir="false"><br>
        </div>
        <div dir="ltr" data-setdir="false">
          <div><?xml version="1.0"?><br>
            <presence xmlns="urn:ietf:params:xml:ns:pidf"
            xmlns:dm="urn:ietf:params:xml:ns:pidf:data-model"
            xmlns:gp="urn:ietf:params:xml:ns:pidf:geopriv10"
            xmlns:gml=<a class="moz-txt-link-rfc2396E" href="http://www.opengis.net/gml">"http://www.opengis.net/gml"</a>
            xmlns:gs=<a class="moz-txt-link-rfc2396E" href="http://www.opengis.net/pidflo/1.0">"http://www.opengis.net/pidflo/1.0"</a>
            xmlns:con="urn:ietf:params:xml:ns:geopriv:conf"
            entity=<a class="moz-txt-link-rfc2396E" href="sip:+6478897789@ims.mnc0xx.mccxxx.3gppnetwork.org">"sip:+6478897789@ims.mnc0xx.mccxxx.3gppnetwork.org"</a>><br>
            <dm:device id="Wifi"><br>
            <gp:geopriv><br>
            <gp:location-info><br>
            <gs:Circle srsName="urn:ogc:def:crs:EPSG::5524"><br>
            <gml:pos>31.204359 -44.512358</gml:pos><br>
            <gs:radius
            uom="urn:ogc:def:uom:EPSG::8190">10.578000</gs:radius><br>
            </gs:Circle><br>
            <con:confidence pdf="normal">92</con:confidence><br>
            </gp:location-info><br>
            <gp:method>DBH_HELO</gp:method><br>
            <gp:usage-rules/><br>
            </gp:geopriv><br>
<dm:timestamp>2022-04-05T19:16:34Z</dm:timestamp><br>
            </dm:device><br>
            <div></presence></div>
            <div><br>
            </div>
            <div dir="ltr" data-setdir="false">i tried few variants:<br>
            </div>
            <div dir="ltr" data-setdir="false"><br>
            </div>
            <div dir="ltr" data-setdir="false">
              <div>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")<br>
                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");<br>
                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");<br>
                xinfo("GML_LOC:
$xml(x=>xpath:/pidf:presence/dm:device/gp:geopriv/gp:location-info/gs:Circle/gml:pos)\n");</div>
              <div><br>
              </div>
              <div dir="ltr" data-setdir="false"><span>and end up with
                  error "unable to evaluate xpath expression":</span></div>
              <div dir="ltr" data-setdir="false"><br>
              </div>
              <div dir="ltr" data-setdir="false"><span>ERROR: xmlops
                  [pv_xml.c:308]: pv_get_xml(): unable to evaluate xpath
                  expression
[/pidf:presence/dm:device/gp:geopriv/gp:location-info/gs:Circle/gml:pos/70]</span><br>
              </div>
            </div>
          </div>
          <div><br>
          </div>
          <div>thanks in advance,</div>
          <div dir="ltr" data-setdir="false">Art<br>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
      <pre class="moz-quote-pre" wrap="">__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
  * <a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>
Important: keep the mailing list in the recipients, do not reply only to the sender!
Edit mailing list options or unsubscribe:
  * <a class="moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla -- <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a>
Kamailio Advanced Training - Online
  * <a class="moz-txt-link-freetext" href="https://www.asipto.com/sw/kamailio-advanced-training-online/">https://www.asipto.com/sw/kamailio-advanced-training-online/</a></pre>
  </body>
</html>