Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSXMLParser question




On Oct 21, 2004, at 11:23 AM, Jesus De Meyer wrote:

Yes, not all RSS feeds are well-formed XML. These feeds aren't correct, but if you want to be able to parse them you can't use NSXMLParser (since a real XML parser won't parse a non-well-formed feed).

So what's the purpose of NSXMLParser then?

For parsing XML documents. RSS feeds are supposed to be well-formed XML documents, but since there's a decent number that aren't (and a decent number that don't fit other criteria, like having the guids really be globally unique), using a real XML parser prevents you from parsing some feeds out there. As someone said (I forget who), be liberal in what you accept and strict in what you generate.

Given that, why are you writing your own RSS parser at all? Brent Simmons has posted open-source code to an RSS parser using CoreFoundation routines. You can find it at <http://ranchero.com/cocoa/rss/>. Note that I haven't looked at it, I'm just assuming it's decent since he's the author of NetNewsWire (and NetNewsWire 2 rocks)

I can't say why, but I checked out the code from Brent. I'm using that instead of NSXMLParser, although it doesn't support the Atom protocol, but I don't think that's used so much.

It's used some and its use is growing (although most sites that have an Atom feed also have an RSS feed). What are you using this for? A new news aggregator? I would suggest creating an atom parser as well if you can.

--
Kevin Ballard
email@hidden
http://www.tildesoft.com
http://kevin.sb.org

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >NSXMLParser question (From: Jesus De Meyer <email@hidden>)
 >Re: NSXMLParser question (From: Kevin Ballard <email@hidden>)
 >Re: NSXMLParser question (From: Jesus De Meyer <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.