<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Daniel,</p>
<p>Many thanks! <br>
</p>
<p>Your "replace" solution looks more elegant than just remove the
whole string.<br>
</p>
<pre class="moz-signature" cols="72">Regards,
Igor</pre>
<div class="moz-cite-prefix">Le 10.02.2022 à 16:52,
Daniel-Constantin Mierla a écrit :<br>
</div>
<blockquote type="cite"
cite="mid:c05b17d4-6630-4606-a057-e376b195f7db@gmail.com">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<p>Hello,</p>
<p>actually the problem is the mess SIMPLE RFC authors made with
XML namespaces, by not setting and not using a prefix for them,
otherwise the #012 is end-of-line printed by syslog as octal
character.<br>
</p>
<p> The solutions:</p>
<p>1) replace "xmlns=" with something else like "xyzwq=":</p>
<p>$xml(body=>doc) = $(rb{s.replace,xmlns=,xyzwq=})</p>
<p>and use xpath without concerning of xml namespaces prefix.</p>
<p>2) register a prefix for the namespace using xml_ns parameter
from xmlops module and use that prefix in xpath expressions.</p>
<p>See a past discussion on the mailing list:</p>
<p> - <a class="moz-txt-link-freetext"
href="https://lists.kamailio.org/pipermail/sr-users/2010-December/066690.html"
moz-do-not-send="true">https://lists.kamailio.org/pipermail/sr-users/2010-December/066690.html</a></p>
<p>Cheers,<br>
Daniel<br>
</p>
<div class="moz-cite-prefix">On 10.02.22 16:25, Igor Olhovskiy
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:12dc4e05-90a4-b597-acdd-11347066218b@gmail.com">
<meta http-equiv="Content-Type" content="text/html;
charset=UTF-8">
<p>Hello<br>
</p>
<p>Just to add, when I'm trying to dump $rb to logs, I'm getting
this line</p>
<pre><?xml version="1.0"?>#012<dialog-info xmlns="urn:ietf:params:xml:ns:dialog-info" version="0" state="full" entity=<a class="moz-txt-link-rfc2396E" href="sip:88881@dev.company" moz-do-not-send="true">"sip:88881@dev.company"</a>>#012 <dialog id="f-XGMVyeO0" direction="recipient">#012 <state>terminated</state>#012 </dialog>#012</dialog-info></pre>
<p>So, I expect problem is in this <font face="Courier New,
Courier, monospace">#012 </font>+ extra spaces. Is there a
way to clean it up in an easy way?<br>
</p>
<pre class="moz-signature" cols="72">Regards,
Igor</pre>
<div class="moz-cite-prefix">Le 10.02.2022 à 16:01, Igor
Olhovskiy a écrit :<br>
</div>
<blockquote type="cite"
cite="mid:266e84de-3069-12bd-e472-8e12edf460cd@gmail.com">
<meta http-equiv="content-type" content="text/html;
charset=UTF-8">
<p>Hello,</p>
<p>I'm trying to get state of endpoint from PUBLISH message in
a most simple way using <font face="Courier New, Courier,
monospace">xmlops</font> module</p>
<p>Trying to make this</p>
<pre>$xml(body=>doc) = $rb;
log("L_ERR", "$rU is now in state $xml(body=>xpath:/dialog-info/dialog/state)\n");</pre>
<p>XML in PUBLISH itself</p>
<pre><?xml version="1.0"?>
<dialog-info xmlns="urn:ietf:params:xml:ns:dialog-info" version="0" state="full" entity=<a class="moz-txt-link-rfc2396E" href="sip:88881@dev.company" moz-do-not-send="true">"sip:88881@dev.company"</a>>
<dialog id="v6qmEYf5yI" direction="initiator">
<state>confirmed</state>
</dialog>
</dialog-info></pre>
<p><br>
</p>
<p>Actual text in log is <br>
</p>
<pre>... <script>: 88881 is now in state
</pre>
<p>Means it's empty. <font face="Courier New, Courier,
monospace">xmlops</font> module is loaded with no
parameters. Tried also string <br>
</p>
<pre>$xml(body=>xpath:/dialog-info/dialog/state/text())
</pre>
<p>-> same result<br>
</p>
<p>What am I missing here?</p>
<p>kamailio 5.4.6<br>
</p>
<pre class="moz-signature" cols="72">--
Thanks in advance,
Igor</pre>
</blockquote>
<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 moz-txt-link-freetext" href="mailto:sr-users@lists.kamailio.org" moz-do-not-send="true">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" moz-do-not-send="true">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" moz-do-not-send="true">www.asipto.com</a>
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda" moz-do-not-send="true">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda" moz-do-not-send="true">www.linkedin.com/in/miconda</a>
Kamailio Advanced Training - Online
Feb 21-24, 2022 (America Timezone)
* <a class="moz-txt-link-freetext" href="https://www.asipto.com/sw/kamailio-advanced-training-online/" moz-do-not-send="true">https://www.asipto.com/sw/kamailio-advanced-training-online/</a></pre>
</blockquote>
</body>
</html>