| Author |
I think Im almost there with the tree..please let mw know what you think
|
Matt Kohanek
Village Idiot
Ranch Hand
Joined: Apr 04, 2009
Posts: 483
|
|
- - I feel like I am getting close with this finally - -
So as someone at the company Im doing this for so succinctly put it:
"Why not just build up the tree from the objects returned by simpleXML?
1) Call Web service
2) Use simple to parse XML into objects
3) loop through objects and add to TreeNode data"
Here I have a class to set a tree node with setters and getters:
edit - continued in reply
|
True wisdom is in knowing you know nothing - Socrates
|
 |
Matt Kohanek
Village Idiot
Ranch Hand
Joined: Apr 04, 2009
Posts: 483
|
|
Or here we go -
I have
to get the data from the service, and then this to parse it:
So now I need to use this to set the value of data:
my problem I guess is what should go in node1.setData();
I think it will be one of three things:
node.setData(node.getChild(deviceId));
or
node.setData(data.getChild(deviceId));
or
node.setData(deviceCollection.getChild(deviceId));
Im playng around with it now, so hopefully I will have the answer on my own soon, but please let me know if you see me going wrong somewhere
|
 |
Matt Kohanek
Village Idiot
Ranch Hand
Joined: Apr 04, 2009
Posts: 483
|
|
Hmm
Ok I have a DeviceCollection class that looks like this:
And if I use simplexml to parse the follwoing into this list object:
What is this list going to look like? I need to study up more on java collections I think..
Im doing so now but if anyone can help clear it up it will save me some time
|
 |
 |
|
|
subject: I think Im almost there with the tree..please let mw know what you think
|
|
|