luasoap element addressing

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

luasoap element addressing

Aidar Kamalov
Hello,

Does anybody use luasoap?
In their examples here https://tomasguisasola.github.io/luasoap/examples.html they are addressing to elements by index, for example ent[1][1][1]. Is it possible to address by tag?

--
Aydar A. Kamalov
Reply | Threaded
Open this post in threaded view
|

Re: luasoap element addressing

Tomás Guisasola
Hi Aidar

> Does anybody use luasoap?
> In their examples here https://tomasguisasola.github.io/luasoap/examples.html they are addressing to elements by index, for example ent[1][1][1]. Is it possible to address by tag?
You have to convert the structure (which comes from LuaExpat's LOM) or
implement a search function.  There are many ways to do it, depending
on your case.  For example, sometimes you are dealing with some kind
of structure such as a tree, then it seems reasonable to produce a
table with string entries for each tag.  But sometimes you have a
sequence of equal tags; then you'd prefer some form of an array.  I
have a suite of functions that combine all of these in a general form.
If you are interested, I can pack it and share...

Regards,
Tomás