[sr-dev] git:5.5:207e0d9f: xmlops: docs - more practical example for xml_ns

Daniel-Constantin Mierla miconda at gmail.com
Mon Feb 14 15:03:46 CET 2022


Module: kamailio
Branch: 5.5
Commit: 207e0d9f80b2e1a48c7c21844f158e231bfd8e1e
URL: https://github.com/kamailio/kamailio/commit/207e0d9f80b2e1a48c7c21844f158e231bfd8e1e

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2022-02-14T13:03:43+01:00

xmlops: docs - more practical example for xml_ns

(cherry picked from commit 0cb6a0640e9e3e2e06d2c5bc68c6177d5bd38b89)

---

Modified: src/modules/xmlops/doc/xmlops_admin.xml

---

Diff:  https://github.com/kamailio/kamailio/commit/207e0d9f80b2e1a48c7c21844f158e231bfd8e1e.diff
Patch: https://github.com/kamailio/kamailio/commit/207e0d9f80b2e1a48c7c21844f158e231bfd8e1e.patch

---

diff --git a/src/modules/xmlops/doc/xmlops_admin.xml b/src/modules/xmlops/doc/xmlops_admin.xml
index 7082b03b1f..d78247d310 100644
--- a/src/modules/xmlops/doc/xmlops_admin.xml
+++ b/src/modules/xmlops/doc/xmlops_admin.xml
@@ -68,13 +68,30 @@ modparam("xmlops", "buf_size", 8192)
 		<title><varname>xml_ns</varname> (str)</title>
 		<para>
 		Register xml namespace prefix. Parameter value must have the format:
-		'prefix=uri'.</para>
+		'prefix=uri'.
+		</para>
+		<para>
+		This is useful when it is needed to access XML documents that specify
+		xmlns without prefix, which is not XML-standard compliant, but it
+		comes with SIP SIMPLE presence bodies.
+		</para>
 		<example>
 		<title>Set <varname>xml_ns</varname> parameter</title>
 		<programlisting format="linespecific">
+<![CDATA[
 ...
-modparam("xmlops", "xml_ns", "rpid=urn:ietf:params:xml:ns:pidf:rpid")
+modparam("xmlops", "xml_ns", "pidf=urn:ietf:params:xml:ns:pidf")
+...
+$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>';
+
+xinfo("status: $xml(x=>xpath:/pidf:presence/pidf:tuple/pidf:status/pidf:basic)\n");
 ...
+]]>
 </programlisting>
 		</example>
 	</section>




More information about the sr-dev mailing list