• 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
Re: NSXMLParser useless with HUGE files
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSXMLParser useless with HUGE files


  • Subject: Re: NSXMLParser useless with HUGE files
  • From: Conrad Taylor <email@hidden>
  • Date: Thu, 15 Dec 2005 20:05:45 -0800

Hi, have you tried using Xerces at apache.org? I have used this many times
with relatively huge XML files.

Good luck,

-Conrad

On 12/15/05, Ian was here <email@hidden> wrote:
>
> 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
>
_______________________________________________
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

References: 
 >Re: NSXMLParser useless with HUGE files (From: Todd Blanchard <email@hidden>)
 >Re: NSXMLParser useless with HUGE files (From: Ian was here <email@hidden>)

  • Prev by Date: Re: NSXMLParser useless with HUGE files
  • Next by Date: Re: Cocoa/Applescript question
  • Previous by thread: Re: NSXMLParser useless with HUGE files
  • Next by thread: KVO / Core Data question
  • Index(es):
    • Date
    • Thread