0

I am able to call https url by NSUrl methods which I can see in console. I can see the whole response xml string in console but I am not able to parse with NSXmlParser. When I am parsing it shows data null with Error 81.

Is there any other parser methods/tuts available which handles parser Error 81(NSXMLParserInvalidEncodingError). Thanks in advance

Updated with Xml file

<?xml version="1.0" encoding="utf-16"?>
<ZSETI>
<KZRL/>
<KDMAT/>
<VIFO>V</VIFO>
<KTT>MO</KTT>
<PWERK/>
<VERARB/>
<VAN>1234</VAN>
<VPGR/>
<EINR>ABC</EINR>
 .
 .
 .</ZSETI>

You can also check my previous question for the same on following link How to parse SAP business connector link in iPhone using Obj-C?

Community
  • 1
  • 1
Navnath Memane
  • 265
  • 1
  • 8
  • 25
  • Can you show us the XML response string? Does it start with an XML declaration which specifies the encoding? – Martin R Sep 06 '12 at 11:00
  • In browser it start from xml tag but when I call in my application and print in console it start from – Navnath Memane Sep 06 '12 at 11:04
  • I have posted some XML response above can u check and guide. thanks – Navnath Memane Sep 06 '12 at 11:10
  • please paste your code...., if you want – Deepesh Sep 06 '12 at 11:12
  • @elppa: I have updated question with parser code... – Navnath Memane Sep 06 '12 at 11:25
  • Please show the output of `NSLog(@"data=%@", data)`, where `data` is the complete response of the URL connection. – Martin R Sep 06 '12 at 11:36
  • I have given [here](http://stackoverflow.com/questions/11983514/how-to-parse-simple-xml/11984080#11984080) the answer for parsing a xml file .Please check and modify as per your xml feed OR Check this [tutorial](http://www.edumobile.org/iphone/iphone-programming-tutorials/parsing-an-xml-file/) – Sanoj Kashyap Sep 06 '12 at 10:52
  • @Martin R : NSLog(@"Succeeded! Received %d bytes of data",[data length]); is Succeeded! Received 21249 bytes of data. and NSLog(@"data=%@", data) is in bytes(8 digits format ...30303030 30303030 30303030). Response string gives me full xml file in console. – Navnath Memane Sep 06 '12 at 12:22
  • The XML declaration says `encoding="utf-16"`, but the data does not look like UTF-16 ! – Martin R Sep 06 '12 at 18:00
  • I have followed http://stackoverflow.com/questions/7637666/nsxmlparser-parsing-xml-file-encoded-using-windows-1256 this link and now my encoding error is finish. Only thing is I am getting [NSPlaceholderString initWithString:]: nil argument' error. Can you check my updated xml and parsing code – Navnath Memane Sep 07 '12 at 09:30
  • That is a new problem and this one has been closes, so you should start a new question for that. – Martin R Sep 08 '12 at 10:04
  • Yup solved:) thanks Martin for followUp. – Navnath Memane Sep 10 '12 at 08:59

0 Answers0