Your Digital Media Has Never Looked So Good

 
EnTerr
** Valued Community Member **
Topic Author
Posts: 3834
Joined: Sun Jan 02, 2011 2:41 am

roXML... no GetChildNodes() on fw3?

Fri Aug 08, 2014 9:29 pm

Just tried testing my code on fw3 (3.1.1198) and it crashes with this:
Member function not found in BrightScript Component or interface. (runtime error &hf4) in ...zY/pkg:/source/somethingSomething.brs(175)

175:         children = xml.GetChildNodes()
Backtrace:
Function xhtml2text(xml As ) As

I trusted the function exists - there is no compatibility notice of any kind in the manual for GetChildNodes( ).
But suddenly it is not there! And without it the XML parser is useless to me.
Good grief you guys - what am i supposed to do now?? :oops:
 
destruk
Posts: 2720
Joined: Sat Dec 18, 2010 4:58 pm

Re: roXML... no GetChildNodes() on fw3?

Sun Aug 10, 2014 10:52 am

You would probably have to use GetChildElements() instead. since they are almost the same thing.
 
EnTerr
** Valued Community Member **
Topic Author
Posts: 3834
Joined: Sun Jan 02, 2011 2:41 am

Re: roXML... no GetChildNodes() on fw3?

Sun Aug 10, 2014 12:49 pm

destruk wrote:
You would probably have to use GetChildElements() instead. since they are almost the same thing.

Nope. Without GetChildElements() i am boned, on perfectly good XML:
BrightScript Debugger> ? xml.parse("<x> a <b> c </b> d </x>")
true
BrightScript Debugger> ? xml.getChildElements()
<Component: roXMLElement>
                                                                   'fair enough, array with 1 roXML
BrightScript Debugger> ? xml.getChildElements()[0].genXML(0)
<b> c </b>                                                         'as expected
BrightScript Debugger> ? ">" xml.getText() "<"
><                                                                 'huh?
BrightScript Debugger> ? xml.genXML(0)
<x><b> c </b></x>                                                  'WAT!
 
EnTerr
** Valued Community Member **
Topic Author
Posts: 3834
Joined: Sun Jan 02, 2011 2:41 am

Re: roXML... no GetChildNodes() on fw3?

Mon Aug 18, 2014 7:35 pm

Answer from RokuCo, please?
Will getChildNotes() be coming to fw 3?

Or will roXML be able to sustain both text and sub-elements on 3.x?
(me experimenting with setBody() / addElement() _seems_ to show it can keep only 1 thing at a time in its head)
 
User avatar
RokuKC
Posts: 315
Joined: Wed Sep 10, 2014 10:44 am
Location: Roku HQ

Re: roXML... no GetChildNodes() on fw3?

Thu Oct 30, 2014 2:14 pm

EnTerr wrote:
Answer from RokuCo, please?
Will getChildNotes() be coming to fw 3?


roXMLElement.GetChildNodes() is only supported for devices running modern firmware.

This has been noted on the documentation.
 
EnTerr
** Valued Community Member **
Topic Author
Posts: 3834
Joined: Sun Jan 02, 2011 2:41 am

Re: roXML... no GetChildNodes() on fw3?

Fri Oct 31, 2014 12:31 pm

RokuKC wrote:
roXMLElement.GetChildNodes() is only supported for devices running modern firmware.
This has been noted on the documentation.

And thank you for adding that note... eventually.

Version incompatibility was undocumented for four months. In the mean time i discovered the method added to the docs and started using it - all July i worked on a channel that depended on it, then beginning of August when testing on fw3, it turned out method is not there - and hence me crying in this thread. And so i had to go back to the drawing board and spend most of August writing my own XML parser because of July's sunk cost. Pardon me if i am unhappy with whoever added the method but "forgot" to note compatibility.

So was i right above that a roXmlElement on fw3 cannot hold both text and sub-elements, at the same time?

The unfortunate thing in that would be i won't be able to use the convenient "dot-filtering" abilities of roXmlElement (i.e. do `xhtml.body.article.section.table.tr.td.div` to zero-in on the content i need) - and will have to re-invent the wheel for doing selection in the tree. Otherwise even if i have to do my own parsing, i could re-construct the result as roXmlElement/roXmlList and use dot-subsetting.

Who is online

Users browsing this forum: No registered users and 8 guests