tags:

views:

74

answers:

1

Hi guys,

NSXMLParser is giving me the following error: "Error 65, Description: (null), Line: 1, Column: 47" I've checked the documentation, and it says that a space is required at column47??. Was hoping someone can help out on this? The raw xml file is as follows. Strangely, the parser works intermittently at times, and for the same xml file.

<?xml version="1.0"?>
<contacts>
  <known>
    <pid>116</pid>
    <abid>188</abid>
    <latitude>1.417320695</latitude>
    <longitude>103.7597807</longitude>
    <status>Available</status>
  </known>
</contacts>
A: 

It's very suspicious that it works intermittently.

Have you retained the data that you're passing into the parser correctly?

Or if you're calling initWithData you might be passing in NSMutableData instead of NSData without knowing it? try

[NXMLParser alloc] initWithData:[[yourData copy] autorelease]]]

I'd investigate the intermittent nature of the bug and make 100% sure that your input data is what you expect it to be.

deanWombourne
I am downloading the xml asynchronously from the server. My guess is that the file hasn't completed the download when the parser was called. Anyways, it's solved using a hacked solution. I simply call the parser again. No problem now
ngzhongcai