Thanks for answer Mo (we know each other, I am posting under a slightly different name),
Heres the code, updated to contain a silly amount of null pointer checks:
- println("Attempting XML load");
-
xml = new XML(this,"scene.xml");
- println(xml); //prints ok
- int numScenes = xml.getChildCount();
- println(numScenes); // prints "3"
- for (int i = 0; i < numScenes; i++) {
- scene = xml.getChild(i);
- print(scene); // doesnt print scene so I am guessing getChild doesnt work
- println(" xml child "+i+" : "+scene);
- if (scene!=null) {
- if (scene.getString("name")!=null) {
-
String name =scene.getString("name");
- println (name);
- }
- }
- //(..)
- }
Then a very minimal xml file looks like this:
- <scene_list name="show1">
- <scene name="test_pattern">
- <camera name="cam added 4th at 16:55" x="0.0" y="0.0" z="985.22504" tx="0.0" ty="0.0" tz="0.0">
- </camera>
- </scene>
- </scene_list>
The error still is
Exception in thread "Animation Thread" java.lang.NullPointerException
at processing.core.XML.getString(XML.java:442)
at processing.core.XML.getString(XML.java:437)
I'd like to point out that "name" attribute is set for every object in the tree,
and that I had this code working in processing 1.5, my problems started with the beta so 'wait until this is resolved' is a ugly short answer that I am expecting to get. But maybe there is something I don't know like getChild being depreciated