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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to