On May 8, 2013, at 6:25 PM, Andy Lee <ag...@mac.com> wrote: > Yup. I had edge-case crashes too (fortunately reproducible one I knew the > right edge case), and spent hours tracking it down to reentrancy problems in > initWithHTML. Fortunately I could count on getting well-formed XML, and like > Jens all I needed was to extract plain text, so I changed my solution to use > NSXMLDocument and the crash went away.
You actually don’t need well-formed X[H]TML to use NSXMLDocument. One of the option flags to the -init method tells it to run the ‘htmltidy’ preprocessor over the input, which will correct even the gnarliest hand-written tag-soup HTML into something the XML parser can handle. It’s extremely useful for handling random web content. —Jens _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com