• 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: TBXML question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: TBXML question


  • Subject: Re: TBXML question
  • From: Jens Alfke <email@hidden>
  • Date: Fri, 13 Jan 2012 19:37:01 -0800

On Jan 13, 2012, at 5:16 PM, Philip Vallone wrote:

> Have you considered using Libxml and xpath? Take a look at http://cocoawithlove.com/2008/10/using-libxml2-for-parsing-and-xpath.html.

 libxml is very powerful but it’s also very low-level, and quite grungy to use. If there’s an Obj-C API available it’d be best to use that unless you’re 100% certain it won’t do what you need.


>>         *  TBXMLElement *playlist = [TBXML childElementNamed:@"playlist"
>> parentElement:element];*
>>
>> *            while (playlist != nil) {*
>>
>> *                NSLog(@"%@", [TBXML valueOfAttributeNamed:@"name"
>> forElement:playlist]); //infinite loop. how loop through all the playlists
>> for the user?*
>>
>> *            }            *

So, I haven’t used TBXML, but it looks like what you need is something like “playlist = playlist->nextSibling” at the bottom of the while loop. The DOM tree is chained together as a linked list of siblings at each level, a pretty typical approach.

—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: 
 >TBXML question (From: "Eric E. Dolecki" <email@hidden>)
 >Re: TBXML question (From: Philip Vallone <email@hidden>)

  • Prev by Date: Re: TBXML question
  • Next by Date: Adding an observer to an NSOperation crashes my app.
  • Previous by thread: Re: TBXML question
  • Next by thread: MAX parsing (Re: TBXML question)
  • Index(es):
    • Date
    • Thread