Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NSXMLParser & Problem

My xml is

<categoryname>Baby</categoryname>  
<id>244</id>                      
<categoryname>Boats & Watercraft</categoryname>  
<idc>1026</id>

I am getting first two nodes.My problem is the third node i am getting Boats only (parser foundCharacters) and & kills the nsxmlparser. I am searching this forum and other websites most of them post use &amp; instead of & in xml . My xml is coming from server and i wont update xml now.Is there any other option to solve this issue.

like image 788
Rams Avatar asked Apr 30 '26 10:04

Rams


1 Answers

If you insist on sending invalid XML from your server this should solve it:

[xmlString stringByReplacingOccurrencesOfString:@"&" withString:@"&amp;"]:
// parse xmlString
[categoryName stringByReplacingOccurrencesOfString:@"&amp;" withString:@"&"]:
like image 58
Erik B Avatar answered May 03 '26 10:05

Erik B



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!