views:

75

answers:

1

Hello there,

still new to XML parsing with the iphone so i have a few questions.

in my opinion, id like my iphone-app to have to request out to the internet as less as possible, so i have combined a few XMLs i had to a single, larger one. However when im parsing information out, it has some similar node-names (not at the same level obviously) however its still causing me issues when trying to parse out my custom objects.

so should i just keep my XML all combined and rename some nodes? or make 2 XML calls?

opinions?

+2  A: 

You need to manually track the state of your tree as you parse. The parser will work through your document in sequence so if you have an XML structure like so:

<a>
    <name>some text</name>
    <b>
     <name>some other text</name>
    </b>
</a>

You need to keep track of when your "a" and "b" elements start and end to know what context you are in.

Greg Martin