iphone - How to parse xml data when end element is having forward and backward slash -
i getting response server
<dataset>\u000d\u000a <table>\u000d\u000a <user_name>ganesh<\/user_name>\u000d\u000a <\/table>\u000d\u000a <\/dataset>" and if trying parse using nsxmal parser delegate methods,it's giving error
localizeddescription operation couldn’t completed. (nsxmlparsererrordomain error 4.)
please me. in advance.
first in case of working xml need follow rules creating. xml not correct number of issue tag name etc there.
and if there issue if have xml in string can find nsstring between 2 strings method. or in other words can find tag value using this.
-(nsstring*)stringbetweenstring:(nsstring*)start andstring:(nsstring)end { nsrange startrange = [self rangeofstring:start]; if (startrange.location != nsnotfound) { nsrange targetrange; targetrange.location = startrange.location + startrange.length; targetrange.length = [self length] - targetrange.location; nsrange endrange = [self rangeofstring:end options:0 range:targetrange]; if (endrange.location != nsnotfound) { targetrange.length = endrange.location - targetrange.location; return [self substringwithrange:targetrange]; } } return nil; }
Comments
Post a Comment