I'd like to use NSXMLParser
to parse a large xml file. There are a few thousand elements on the root level, so it's too large for a tree based approach. Ideally, I would like to parse each of those one thousand elements individually into a tree and then do some (more complicated) parsing on them. I only need the string values (including the xml markup) of these root level elements which I can then hand off to my already existing tree based parser. I wasn't able to find out how to do that with NSXMLParser
, if possible at all.
Imagine an xml file like this
<start>
<record>
<title>The Title</title>
<content>Some content</content>
</record>
<record>
<title>The Title</title>
<content>Some content</content>
</record>
</start>
For each record
, I'd like to get a string containing <title>The Title</title> <content>Some content</content>
.