Flutterby™! : Apple's XML parser: b0rk3n

Next unread comment / Catchup all unread comments User Account Info | Logout | XML/Pilot/etc versions | Long version (with comments) | Weblog archives | Site Map | | Browse Topics

Apple's XML parser: b0rk3n

2006-02-09 01:42:50.965536+00 by Dan Lyke 3 comments

Aha! This very useful article on parsing XML with Apple's Cocoa XML Parser was written by Mark Dalrymple, an occasional participant here, and it notes that:

The last common case is expanding entity references, like < and >. There is the kCFXMLparserReplacePhysicalEntities flag you could give to the parser which supposedly will expand the basic entities, that doesn’t really work (another “unsupported feature”), so you have to have code to expand the basic entities, as well as any other entities your XML might be using (which somewhat defeats the use of the XML services as a general XML parser).

uhm, yeah, ya know, it's not a freakin' XML parser unless it handles entities, and if you're going to way the hell over-complexify the API for stupid string and file handling, including all sorts of wacky ways to manage character set encoding (although, surprisingly, no obvious ones for "how many bytes is this string going to take in this encoding?"), why did Apple think it appropriate to ship this horrible excuse for an XML parser? Except for all of the freakin' complexity around this thing (none of which I'm using), what they've actually bothered to implement is probably an hour and a half's worth of work, but given the state of the documentation, figuring out that they just slapped together a framework, including some flags which silently don't do anything (but make you think that they might) it takes several hours to figure that out!

Hey, Apple: You're not as bad as Microsoft[Wiki], I'll give you that, but ... yeesh... next time I will be going with the open source API first. And when you hear that, think strongly about what your value add on a platform is.

[ related topics: Free Software Apple Computer Microsoft Open Source Software Engineering moron Work, productivity and environment Macintosh ]

comments in ascending chronological order (reverse):

#Comment Re: made: 2006-02-09 15:03:33.410914+00 by: markd

That article is getting old in the tooth - the CFXML jazz has been superseded by some Cocoa APIs that are wrappers around libxml2, which seem to do the Right Thing. CFXMLParser is a disaster in general. If you really want to experience pain, check out the directory services API (Aaron writes about it in AMOSXP)

#Comment Re: made: 2006-02-09 18:01:37.533117+00 by: Dan Lyke

So... [ducking] uh... is Carbon deprecated?

#Comment Re: made: 2006-02-10 01:09:16.443088+00 by: Mars Saxman

Why, Dan, whatever could have given you such a strange idea? Of course not. Apple loves both children just exactly the same amount.