0

I'm getting an XML document like this:

<node label = "NAME1" description = "DESCRIPTION1" id = "1">
    <node label = "SON1" description = "SONDESCRIPTION1" id = "S1">
       <node label = "SON1-1" description = "SONDESCRIPTION1-1" id = "S1-1">
         <node label = "SERVICE1" description = "SERVICEDESCRIPTION1" id = "Se1" />
       <node label = "SON1-2" description = "SONDESCRIPTION1-2" id = "S1-2">
    <node label = "SON2" description = "SONDESCRIPTION2" id = "S2">
    ....

The idea is that I'm receiving a folder tree with services. I'm thinking in get the XML, and put all the sons in a NSArray, create a new CXMLDocument with the sons and without the root. Then create an NSArray with all the sons and create as many CXMLDocuments as a I need, and again..

My idea is show in a TableView all the sons (SON1, SON2..) and when you touch then you go to other TableView with, in the example of SON1: SON1-1, Service1...

At first I don't know if it is the best way but in case it was I don't know how to create a document with the sons of a node.

Something like this:

while whatever {
    NSArray *root = [doc children];
    for(CXMLElement *son in root){
       doc = new XML Starting in SON1.
    }

Anyone knows how implement that? Thanks.

Sergiodiaz53
  • 1,268
  • 2
  • 14
  • 23
  • I can't understand. What is your problem? In keeping xml or working with tableview? – Pheu Verg Jan 17 '13 at 10:39
  • My problem is that I don't know how to go through the XML getting the sons because there isn't a method to generate a new doc with a son node. I can get the first list (which only contains NAME1), then I don't know how to get the next list (SON1, SON2), and next (SON1-1, SERVICE1, SON1-2...) Sorry if I'm not explaining myself very well. – Sergiodiaz53 Jan 17 '13 at 10:44
  • 1
    https://github.com/TouchCode/TouchXML/blob/master/Support/Coverage/CXMLElement.m.gcov theCurrentNode = theCurrentNode->next; I googled "touchxml next child" – Pheu Verg Jan 17 '13 at 11:27

0 Answers0