Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

wesg

macrumors regular
Original poster
Jan 2, 2008
211
0
Toronto, ON
I'm working on an application that analyzes the iTunes XML file, and I'm also considering one that does something similar for the iPhoto library. What is the best way to determine the number of tracks/photos in the different libraries?

WHen I open either file with Property List editor I see the correct value, but when I count nodes with Cocoa, I get more than the actual value. Any suggestions for traversing a particular node inside the XML file?
 

yeroen

macrumors 6502a
Mar 8, 2007
944
2
Cambridge, MA
In general, this is accomplished with XQuery and XPath. Cocoa provides an interface this standard via the NSXML Core Foundation class.

You can read about it here:

NSXML
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
Aren't they just property lists? So you should be able to walk through it via NSDictionary/NSArray, etc. Maybe your counting is off :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.