How to hadle a tags inside another tags in NSXMLParser
Posted
by
SimpleMan
on Stack Overflow
See other posts from Stack Overflow
or by SimpleMan
Published on 2012-06-14T12:56:08Z
Indexed on
2012/06/18
15:16 UTC
Read the original article
Hit count: 245
I have a file:
<xml>
<component>something
<system>somethingDeeper
<value>somethingDeepest</value>
</system>
</component>
<component>somethinfDifferent
<value>somethingDifferentDeeper</value>
</component>
<value>somethingNew</value>
</xml>
So i want to distinguish what is inside another tag (ex. <system>) what is not. How to do this with NSXMLParser ? I currently use BOOL ivar's but this is a lot of tags and this is not as elegant as i want it to be. I know that NSXMLParser is a SAX parser and i understand that.
In above example I will be enter to didEndElement method three times with:
elementName equal value Is there a more elegant way to distinguish what entry was from <component> tag above what not?
© Stack Overflow or respective owner