Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
daverooneyca
Visitor

Dump SceneGraph Node to XML

Hi all - is there a simple way to dump out an arbitrary SG Node to XML?  I looked at getAllMeta but it doesn't give the proper node types and attributes.  I'd like to use it for debugging purposes so that I don't have to traverse the SG tree by hand with getChildCount and getChild.
0 Kudos
2 REPLIES 2
joetesta
Roku Guru

Re: Dump SceneGraph Node to XML

If it's purely for debugging, did you check out these functions? 
https://sdkdocs.roku.com/display/sdkdoc/Debugging+Scene+Graph+Applications#DebuggingSceneGraphApplic...
Although not sure if they're any help since they're similar to what you're already trying...
aspiring
0 Kudos
EnTerr
Roku Guru

Re: Dump SceneGraph Node to XML

Most content of roSgNode&co is already accessible by using the reflection methods from ifSGNodeField and ifSGNodeChildren.

It would be next to trivial writing a recursive function to dump that in XML. This conversion however cannot be 100%, since some field values are composite objects - while XML attributes can only be primitive types (strings, really). In other words, there is no 1:1 mapping between the two; not all roSgNodes can be put back in XML can.

And a notable sore thumb remain the functions, which RSG treats like red-headed stepchild and won't admit even their names.
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.