XML bug, Revolution simply stops executing...

Sarah Reichelt sarahr at genesearch.com.au
Sun Jul 11 22:52:18 EDT 2004


> I've got a XML Tree made of a XML-RPC call, the tree works and I am 
> able to extract the contents of the elements. When trying to count the 
> children of a given node, Revolution simply stops executing the 
> handler without giving any info. I've got this lines
>
> put "counting children... " into field "log"
> get revXMLNumberOfChildren(tTreeID, "/methodCall/params")
> put "result:" & it && the result after field log
>
> the Tree is alive for just before this I extract the 
> /methodCall/methodName with success. When executing this code, the 
> field log goes "counting children..." then nothing. no "Result:", no 
> error on Rev IDE, nothing inside it or the result, everything 
> empty.... the handler simply stops. Any clue?
>
> PS: in this test /methodCall/params got 2 children. The XML is glued 
> below:
snip

Hi Andre,

I tested your xml and it worked fine but you are using the wrong number 
of parameters in your call to revXMLNumberOfChildren().

I get the required result (2) with both of these lines:
put revXMLNumberOfChildren(tTreeID, "methodCall/params", "param", 0)
put revXMLNumberOfChildren(tTreeID, "methodCall", "param", -1)

The first checks only for "param" in the first level of the "params" 
tag.
The second checks all levels from the root tag down and counts all 
instances of "param" in the document.

Note that although the docs indicate that the 4th parameter is 
optional, in my tests I got an error if I left it out.

BTW: if you want any more info, you might like to check out my XML 
tutorial :-)
http://www.troz.net/Rev/RevProjects/XMLdemo1.rev.gz

Cheers,
Sarah



More information about the use-livecode mailing list