Re: NSXMLParser useless with HUGE files
Re: NSXMLParser useless with HUGE files
- Subject: Re: NSXMLParser useless with HUGE files
- From: Ian was here <email@hidden>
- Date: Thu, 15 Dec 2005 19:44:28 -0800 (PST)
I have that same problem and I upped the memory
requirements for my software.
--- Todd Blanchard <email@hidden> wrote:
>
You could try a different parser:
>
>
http://homepage.mac.com/tblanchard/ObjectiveExpat
>
>
>
On Dec 14, 2005, at 7:26 AM, Matt Gough wrote:
>
>
> I have a 1.91GB (2,048,406,952 bytes to be
>
precise) xml file that I
>
> am trying to parse. I thought that NSXMLParser
>
would be able to
>
> cope with it, but it can't as it fails with
>
> NSXMLParserOutOfMemoryError.
>
>
>
>
>
> E.g
>
>
>
> NSXMLParser* parser = [[NSXMLParser alloc]
>
initWithContentsOfURL:
>
> [NSURL fileURLWithPath:path]];
>
>
>
> [parser setDelegate:self];
>
> [parser parse];
>
> [parser release];
>
>
>
>
>
> It seems that during initWithContentsOfURL it
>
tries to read in the
>
> entire file! Why can't it just be streamed in as
>
needed during
>
> [parser parse]?
>
>
>
> So then I thought that maybe I could do:
>
>
>
> NSData* mappedData = [NSData
>
dataWithContentsOfMappedFile:path];
>
> NSXMLParser* parser = [[NSXMLParser alloc]
>
initWithData:mappedData];
>
>
>
> But it still runs out of memory.
>
>
>
> Would CFXMLParser be any better, or would it
>
suffer the same problem?
>
>
>
>
>
>
>
> BTW - Can anyone suggest a text editor that is
>
able to work with
>
> such a file so that I can chop it down into more
>
manageable
>
> portions that I can parse individually and then
>
merge the results?
>
>
>
> Matt Gough
>
> Softchaos Limited
>
> _______________________________________________
>
> Do not post admin requests to the list. They will
>
be ignored.
>
> Cocoa-dev mailing list
>
(email@hidden)
>
> Help/Unsubscribe/Update your Subscription:
>
>
>
>
>
>
> This email sent to email@hidden
>
>
_______________________________________________
>
Do not post admin requests to the list. They will be
>
ignored.
>
Cocoa-dev mailing list
>
(email@hidden)
>
Help/Unsubscribe/Update your Subscription:
>
>
>
This email sent to email@hidden
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden