The one thing that has helped me parse the XML streams is to think of it as a water faucet.
As the flow of data comes pouring in from the data source, you redirect it to different pipes on the fly. Evaluating the elements to determine which pipe path you go down.
Store all the water/data in a bucket (storage variable) till you hit the end of the flow (end of the element).
Then dump the bucket into it's final container (class variable, dictionary object, what ever). Then go back up the pipe structure and watch the flow again, till the flow ends.
-------
Back to part of the SOAP discussion.
In my recent research, it is becoming very apparent that REST is growing in popularity and in support. Not just on the iPhone, but also the BlackBerry and Android.
For those of you with SOAP webservices now; You could use different tools to create a REST Wrapper around your SOAP... even if the SOAP is hosted by someone totally else. I was able to do this with .NET fairly quickly, capturing the SOAP calls via the SOAP extensions, and returning just the SOAP Message segment as a raw XML stream.
Granted I am just doing it a temporary solution, as I work on the iPhone product and another team works to add formal REST support to our services.
My suggestion would be to limit the amount of time and energy to stuff SOAP into your iPhone app, but to look at the core webservice to see if it can be converted to REST, or with at least a REST wrapper. Especially if it is going to be a widely used WebService by multiple platform.
|