if you have $xml(bla) = "....some xml....";

Try like $xml(bla/isComposing.attr/xmlns)

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  https://www.opensips-solutions.com
  https://www.siphub.com


On 5/6/26 22:19, Robert Dyck wrote:

I am trying to understand $xml() and added some logging to the script.

I know the contents of the xml doc.

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>

<isComposing xmlns="urn:ietf:params:xml:ns:im-iscomposing">

<state>active</state>

<contenttype>text/plain</contenttype>

<refresh>60</refresh>

 </isComposing>'


Using statements such as "xlog("xlm is $xml(?xml/isComposing)\n");"

I get DBG:xml:pv_get_xml: Unknown object <?xml>
The same if I ignore the version element and try "isComposing".

It says Unknown object <isComposing>


Printing the entire $xml doesn't work.

BG:core:parse_headers_aux: flags=ffffffffffffffff
[266B blob data]

On Wednesday, May 6, 2026 1:08:11 a.m. Pacific Daylight Time you wrote:

> According to the grammar [1], you have access to the attributes:

>

> access = .val | .attr/string | .attr/$var

>

> An example:

>

> $xml(my_doc/doc/list.attr/sort) = "asc";              # add attribute "sort"

> to list node

>

>

> [1] https://opensips.org/docs/modules/3.6.x/xml.html#pv_xml

>

> Bogdan-Andrei Iancu

>

> OpenSIPS Founder and Developer

> https://www.opensips-solutions.com

> https://www.siphub.com

>

> On 5/4/26 17:31, Robert Dyck wrote:

> > Yes.

> > Or perhaps just detect the the presence of xlm. It should not go into the

> > silo.

> >

> > On Monday, May 4, 2026 6:48:50 a.m. Pacific Daylight Time you wrote:

> >> You mean the xmlns attribute of the isComposing node ?

> >>

> >> Regards,

> >>

> >> Bogdan-Andrei Iancu

> >>

> >> OpenSIPS Founder and Developer

> >>

> >> https://www.opensips-solutions.com

> >> https://www.siphub.com

> >>

> >> On 4/27/26 19:21, Robert Dyck wrote:

> >>> I have looked at the module and it is not clear to me how one would

> >>> extract the name space from the xml.

> >>>

> >>>

> >>> <?xml version="1.0" encoding="UTF-8" standalone="no" ?>

> >>> <isComposing xmlns="urn:ietf:params:xml:ns:im-iscomposing">

> >>>

> >>>         <state>active</state>

> >>> <contenttype>text/plain</contenttype>

> >>>         <refresh>60</refresh>

> >>>

> >>> </isComposing>'

> >>>

> >>>   _______________________________________________

> >>>

> >>>>> Users mailing list

> >>>>>

> >>>>> [email protected]

> >>>>>

> >>>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users

> >>>

> >>> On Monday, April 27, 2026 7:31:14 a.m. Pacific Daylight Time you wrote:

> >>>> Robert,

> >>>>

> >>>>

> >>>>

> >>>> Check thishttps://opensips.org/docs/modules/3.6.x/xml.html

> >>>>

> >>>>

> >>>>

> >>>> Regards,

> >>>>

> >>>>

> >>>>

> >>>> Bogdan-Andrei Iancu

> >>>>

> >>>>

> >>>>

> >>>> OpenSIPS Founder and Developer

> >>>>

> >>>> https://www.opensips-solutions.com

> >>>>

> >>>> https://www.siphub.com



_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

Reply via email to