Reputation:
i am getting problem while reading xml files through nsxmlparser in ios,
<PRODUCTS>
<PRODUCTSLIST>
<PRODUCTDETAILS>
<headertext> test header </headertext>
<description><b style="font-size: x-small;">product, advantages</b></description>
</PRODUCTDETAILS>
</PRODUCTSLIST>
</PRODUCTS>
while i read the file using nsxmlparser i am able to get value(test header) for headertext but the description attribute value contains html tags so i cant able to get the result (<b style="font-size: x-small;">product, advantages</b>)
i am getting result as empty
How can i get the result as((<b style="font-size: x-small;">product, advantages</b>)
) for description attribute?
Upvotes: 0
Views: 236
Reputation: 6011
Your problem is that the "b" tag is considered part of the XML structure, try escaping the '<' and '>' characters of the 'b' tag:
@"<b style=\"font-size: x-small;>product, advantages</b>"
see here
Upvotes: 0
Reputation: 1576
Speaking from a developers perspective I would not recommend using NSXMLParser due to it's laborious way to parse XML Files. There is a great write up about choosing the right XML Parser.
I use KissXML quite often. You can find a quit tutorial of using it here.
Hope this helps.
Upvotes: 2