From the XML below I'm trying to retrieve the second element in the sequence. Notice the end node is the same as the start in each entry, this is making its retrieval a bit tricky.
I've tried setting a for loop at the startElementSAX function to evaluate and pick-up the Width="60" attribute. Although this will sort the data correctly it still results in the targeted property receiving the last path in the sequence. I presume it's because in order to retrieve the attribute for the node it need to be discovered first. So this is also getting sent each time. I've not been able to find a way of isolating this from happening.
I've made a trace which confirms all three paths are sent each time regardless of the start criteria. This wouldn't be a problem if I was able to be attach them to different properties.
If you want to look at the project in it's entirety it's in the Apple iPhone Dev Centre called TopSongs. You may need a password.
<itms:coverArt height="53" width="53">http://a1.phobos.apple.com/us/r1000/030/Music/7f/b0/f6/mzi.erhtxklr.53x53-50.jpg</itms:coverArt>
<itms:coverArt height="60" width="60">http://a1.phobos.apple.com/us/r1000/030/Music/7f/b0/f6/mzi.erhtxklr.60x60-50.jpg</itms:coverArt>
<itms:coverArt height="100" width="100">http://a1.phobos.apple.com/us/r1000/030/Music/7f/b0/f6/mzi.erhtxklr.100x100-75.jpg</itms:coverArt>
This is the endElement code I have so far.
static void endElementSAX(void *parsingContext, const xmlChar *localname, const xmlChar *prefix, const xmlChar *URI) {
iTunesRSSImporter *importer = (iTunesRSSImporter *)parsingContext;
if (importer.parsingASong == NO) return;
} else if (!strncmp((const char *)prefix, kName_Itms, kLength_Itms)) {
if (!strncmp((const char *)localname, kName_CoverArt, kLength_CoverArt)) {
importer.currentSong.coverArt60 = importer.currentString;