• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSXMLParser Error 27 and Crash
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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>&nbsp;&gt;&nbsp;</li>

...right at the beginning of the second "&nbsp". 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


  • Prev by Date: Re: Application Design
  • Next by Date: Re: Creating drag images from NSView snapshots
  • Previous by thread: Re: Application Design
  • Next by thread: Re: Creating drag images from NSView snapshots
  • Index(es):
    • Date
    • Thread