• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Does initWithHTML:dataUsingEncoding:documentAttributes: run an event loop?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Does initWithHTML:dataUsingEncoding:documentAttributes: run an event loop?


  • Subject: Re: Does initWithHTML:dataUsingEncoding:documentAttributes: run an event loop?
  • From: Andy Lee <email@hidden>
  • Date: Thu, 09 May 2013 14:52:25 -0400

On May 9, 2013, at 1:53 PM, Markus Spoettl <email@hidden> wrote:

> On 5/9/13 6:26 PM, Jens Alfke 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.

Good to know.

> Well, that's not entirely true, unfortunately. Although the documentation suggests you can, NSXMLDocument -init.... will crash if the content you're trying to feed it is sufficiently non-XML (say an ASCII text file).
>
> We get this all the time and it's a major pain.

And good to know.

Thanks!

--Andy


_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden


References: 
 >Does initWithHTML:dataUsingEncoding:documentAttributes: run an event loop? (From: Jean Suisse <email@hidden>)
 >Re: Does initWithHTML:dataUsingEncoding:documentAttributes: run an event loop? (From: Ken Thomases <email@hidden>)
 >Re: Does initWithHTML:dataUsingEncoding:documentAttributes: run an event loop? (From: Jens Alfke <email@hidden>)
 >Re: Does initWithHTML:dataUsingEncoding:documentAttributes: run an event loop? (From: Andy Lee <email@hidden>)
 >Re: Does initWithHTML:dataUsingEncoding:documentAttributes: run an event loop? (From: Jens Alfke <email@hidden>)
 >Re: Does initWithHTML:dataUsingEncoding:documentAttributes: run an event loop? (From: Markus Spoettl <email@hidden>)

  • Prev by Date: Re: Does initWithHTML:dataUsingEncoding:documentAttributes: run an event loop?
  • Next by Date: Can scroll direction be changed programmatically?
  • Previous by thread: Re: Does initWithHTML:dataUsingEncoding:documentAttributes: run an event loop?
  • Next by thread: Re: Does initWithHTML:dataUsingEncoding:documentAttributes: run an event loop?
  • Index(es):
    • Date
    • Thread