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, 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.