[sr-dev] git:master:0cb6a064: xmlops: docs - more practical example for xml_ns
Daniel-Constantin Mierla
miconda at gmail.com
Thu Feb 10 17:06:45 CET 2022
Module: kamailio
Branch: master
Commit: 0cb6a0640e9e3e2e06d2c5bc68c6177d5bd38b89
URL: https://github.com/kamailio/kamailio/commit/0cb6a0640e9e3e2e06d2c5bc68c6177d5bd38b89
Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2022-02-10T17:06:13+01:00
xmlops: docs - more practical example for xml_ns
---
Modified: src/modules/xmlops/doc/xmlops_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/0cb6a0640e9e3e2e06d2c5bc68c6177d5bd38b89.diff
Patch: https://github.com/kamailio/kamailio/commit/0cb6a0640e9e3e2e06d2c5bc68c6177d5bd38b89.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