revXMLNodeContents

Ken Ray kray at sonsothunder.com
Sat Aug 20 00:11:42 EDT 2005


On 8/19/05 7:37 PM, "Martin BLACKMAN" <martinblackman at gmail.com> wrote:

> Could anyone comment on whether the behaviour of the first example
> below is correct ?  I would have thought that both outputs should be
> the same ??
>   
>   put "<root>This is <child>a test</child></root>" into tXML
>   put revcreateXMLtree(tXML,false,true,true) into tID
>   put revXMLRootNode(tID) into tnode
>   answer revXMLNodeContents(tID,tnode)
>  --Outputs 'this is a test'
> 
>   put "<root>This is <wrap><child>a test</child></wrap></root>" into tXML
>   put revcreateXMLtree(tXML,false,true,true) into tID
>   put revXMLRootNode(tID) into tnode
>   answer revXMLNodeContents(tID,tnode)
> --Outputs 'this is '

Personally, I think this is a bug - on two levels:

1)  Since the <wrap> tag has no text contents, it stops revXMLNodeContents
from going any deeper than "This is ". (If you did <wrap>certainly <child>
... and ran it, you'd get "This is certainly a test".)

2) To my understanding, revXMLNodeContents shouldn't go to any children of
the node you identify - it should always return "This is ".

Personally, I'd log it is a bug in Bugzilla...

Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com





More information about the use-livecode mailing list