Dumb XML library question
Dave Cragg
dave.cragg at lacscentre.co.uk
Tue Aug 5 16:20:11 EDT 2014
On 5 Aug 2014, at 16:54, Mark Wieder <mwieder at ahsoftware.net> wrote:
> You can also step through them with revXMLFirstChild and
> revXMLNextSibling.
>
> put field 1 into tData //source of xml text
> put revXMLCreateTree(tData,true,true,false) into tID
> put revXMLFirstChild(tID, "person/aliases") into tChild
> breakpoint
> if tChild is not empty then
> repeat until tChild is empty
> -- now you are pointing to a child node
> -- do something with the tChild contents
> put revXMLNextSibling(tID, tChild) into tChild
> end repeat
> end if
Thanks Mark,
I noticed that with "revXMLChildNames", you can filter on which child nodes you want to get. So if there were other nodes as siblings of "name", using "revXMLChildNames" might be more useful. But for a more general walk through the child nodes, your approach looks better.
Cheers
Dave
More information about the use-livecode
mailing list