• 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: Parsing common elements between xml documents
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Parsing common elements between xml documents


  • Subject: Re: Parsing common elements between xml documents
  • From: Malayil George <email@hidden>
  • Date: Sun, 18 Apr 2010 18:50:35 -0400

Thanks Jens. I switched to TinyXML to do my xml parsing and things have been
going well so far. Since, all the xml documents I will be parsing are pretty
small, I think it should be ok (shouldn't cause much of a memory overhead
with the DOM route).


George

On Sat, Apr 17, 2010 at 8:58 PM, Jens Alfke <email@hidden> wrote:

>
> On Apr 17, 2010, at 12:42 PM, Malayil George wrote:
>
> > But, I figure it would be easier if I could set
> > up a parser that would parse B into it's object and return it. So, while
> > parsing A, when I encounter element B, I would like to hand-off the
> entire B
> > element to my B parser and have it return object B. This way, while
> parsing
> > doc D, I could do the same thing (and not have to duplicate code for
> parsing
> > B) and my code is more readable. However, I am not able to figure out how
> to
>
> You can do this with a stream-based parser but it takes a bit of work. You
> keep a stack of which object you’re currently building, and when you finish
> an element you pop the corresponding object and hand it to the new top
> object, to store a reference to it.
>
> This sort of thing is easier with a DOM-based parser where you can inspect
> the entire tree of objects at once, but the Cocoa one (NSXMLDocument) isn’t
> available on iPhone for some reason.
>
> —Jens
_______________________________________________

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

References: 
 >Parsing common elements between xml documents (From: Malayil George <email@hidden>)
 >Re: Parsing common elements between xml documents (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: Weird CGFloat issue
  • Next by Date: Introspecting the current method
  • Previous by thread: Re: Parsing common elements between xml documents
  • Next by thread: Baffling Button Behavior
  • Index(es):
    • Date
    • Thread