What I’m trying to achieve is to say, having an XML structure like this:
<parent>
<nodename1>NodeText1</nodename1>
<nodename2>NodeText2</nodename2>
...
<nodenamex>NodeTextx</nodenamex>
</parent>
And upon parsing, set it into an NSMutableDictionary into key=>value pairs where key is the nodename and the value is nodetext. However, I have no idea how to link them both because, if I understand correctly, the nodename is recognized in didStartElement and nodetext gets picked up in foundCharacters, right? Does anyone know how to do this? I can post the code I have so far but it’s pretty basic.
Thanks,
In the didStartElement method, when you identify node name as “parent”, create a dictionary.
In found characters, store the value in string object.
In didEndElement method, if string value (you have in foundcharacters) is not null then add into a dictionary with key as element name. Now, release the string value and assigned it to nil.