Good to know. Actually, I was imitating the order I saw in the XML GET NEXT ELEMENT example code, which has the text below the sub-elements. I am an XML noob. Hopefully, the real-world files I'm working with will all have text above sub-elements in any mixed content. If not, it could get messy. Not trying to be critical. If not already there, your plugin is approaching awesome.
Need to know a bit more about the XML RELEASE ELEMENT command, since I will be processing very large files and want to avoid a million memory leaks.
Q1. Since the same "ToElement" number can be "re-used" for successive operations, is releasing that same element number
one time at the end sufficient?
Q2. It seems that if I release an element number that has already been released, it fails silently (good thing). It also seems that if I release an element number that has never been used, it fails silently (good thing). Put another way, in the absence of a "release all" command, do you see any problems with the following code?
for i = 1 to 1000
XML RELEASE ELEMENT i
next i
XML GET NEXT ELEMENT. This has two forms. I will have a need to parse an unknown number of the same element name. There could be ten or ten thousand of them. With the following code I can get the text of the first instance of "JUNGLE" and all successive "JUNGLE"s.
xml get child element 1, "JUNGLE", 2
message xml get text (2)
do
XML GET NEXT ELEMENT 2, 2
if xml get element name (2) = "JUNGLE"
message xml get text (2)
else
exit
endif
loop
The second form of the command seems applicable but will always error out after the last one is reached.
xml get child element 1, "JUNGLE", 2
message xml get text (2)
do
XML GET NEXT ELEMENT 2, "JUNGLE", 2
if not (xml is valid element (2)) then exit
message xml get text (2)
loop
Q3. Is there any way to intercept the error? Maybe an option to turn it off?