Greetings Everyone,
I'm having a little trouble with a script I'm doing that work with XML trees.
I'm trying to get all the nodes from the XML tree (in memory) and add them to a dataArray to put on a datagrid form.
I'm using a loop with the revXMLFirstChild(...) and revXMLNextSibling(...) to iterate through the nodes and get the data I need.
However, one of the attributes need to add to the array is the node name.
Using the revXMLFirstChild(...) and revXMLNextSibling(...) functions the result is something like this: "/tokens/single[1]"
so, the information I need to set is only the "single".
I tried to search around for some function or way to do it but had no luck with it.
Anyone has any idea on how can I do this?
Many thanks ins advance,
- Miguel
How To - get XML node name
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: How To - get XML node name
Hi Miguel,
Do you mean that you want to get the node name from the string "/tokens/single[1]"?
Kind regards,
Mark
Do you mean that you want to get the node name from the string "/tokens/single[1]"?
Code: Select all
set the itemDel to slash
put last item of myXmlPath into myNode --> single[1]
set the itemDel to "["
put item 1 of myNode into myNode --> single
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: How To - get XML node name
Greetigns Mark

Many thanks
- Miguel
this was very helpful!! thanks a lotput last item of myXmlPath into myNode --> single[1]

Many thanks
- Miguel