NSXMLParser Error 27 and Crash
NSXMLParser Error 27 and Crash
- Subject: NSXMLParser Error 27 and Crash
- From: Eric Balch <email@hidden>
- Date: Sun, 1 Jul 2007 02:43:27 -0700
Ok, I'm stumped!
I'm using NSXMLParser for the first time and things have been
progressing nicely until I ran into the following:
The parser returns an error code of 27 which has no description --
the documented errors jump from 26 to 28 -- then the app crashes.
I'm using the parser to parse some HTML in this case and the line
it's barfing on is...
<li><a href="index.html">Home</a> > </li>
...right at the beginning of the second " ". It really doesn't
what I do to this line of HTML though, the parser always reports the
same error at the same position. Very odd.
I'm assuming this has something to do with the crash. I just have no
clue as to what is going wrong.
To start things off I do this:
- (void)parseURL:(id)url
{
BOOL success;
NSURL *xmlURL = [NSURL URLWithString: url];
if (myParser)
[myParser release];
myParser = [[NSXMLParser alloc] initWithContentsOfURL:xmlURL];
[myParser setDelegate:self];
[myParser setShouldResolveExternalEntities:NO];
success = [myParser parse]; // return value not used
// if not
successful, delegate is informed of error
}
And my parser implements:
- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)
elementName namespaceURI:(NSString *)namespaceURI qualifiedName:
(NSString *)qName attributes:(NSDictionary *)attributeDict
- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string
- (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)
elementName namespaceURI:(NSString *)namespaceURI qualifiedName:
(NSString *)qName
- (void)parser:(NSXMLParser *)parser parseErrorOccurred:(NSError *)
parseError
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden