i just checked how this will be done in Python - it would be to ask for the .tail
of the <a>
element, like so:
>>> import xml.etree.ElementTree as et
>>> e = et.fromstring('<xml> <tag1 class="class1"> <a href="http://www.google.com">Google!</a> Some more text goes here </tag1> </xml>')
<Element xml at 442968>
<Element tag1 at 4427d8>
<Element a at 4429b8>
' Some more text goes here '
'<a href="http://www.google.com">Google!</a> Some more text goes here '
Simplifying the BRS example even more:
BrightScript Debugger> x = CreateObject("roXMLElement")
BrightScript Debugger> x.parse("<xml> foo <tag> bar </tag> qux </xml>")
BrightScript Debugger> ? x.genXML(false)
<xml><tag> bar </tag></xml>
genXML should have reconstituted (more or less) the original but seems Foo and Qux have been lost in translation. Even Foo, that should've been the getText() to <xml>. Bugs?
PS. in sample python libraries
, "foo" will be made .text to <xml/>, "qux" is .tail to <tag/>, all is preserved/accessible.
PPS. i can think of alternative representation too, in which <xml/> will have 3 children,  being the string "foo" (or element with empty getName and "foo" as getText), then  is <tag> as usual,  the "qux" text (string or another empty tag). Then ifXMLElement.getText() will have to be clarified to "returns the first
text contained in the element". This is less hacky and more to the spirit of xml but likely requires more changes in parser and may surprise some existing BRS code that is very stuck up on the sequence list it gets from getChildElements().