• 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: Issue with NSXMLDocument and bad HTML
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Issue with NSXMLDocument and bad HTML


  • Subject: Re: Issue with NSXMLDocument and bad HTML
  • From: Andy Lee <email@hidden>
  • Date: Tue, 18 Oct 2005 18:27:44 -0400

On Oct 18, 2005, at 4:51 PM, John Stiles wrote:
Actually, I think it is malformed. It claims to be XHTML, but contains JavaScript that is not inside a comment block. Look for "adPosTop". It's valid HTML, but that's not really the same thing.
That was just the first thing I found; it could be malformed in lots of other creative ways as well :)

I wouldn't use an XML parser to parse someone else's HTML -- even HTML that promises to be XHTML. I just don't trust anybody (even myself) to write perfect XHTML. I would either write my own parser or find something that's specifically designed to be an HTML parser, and to deal with imperfections. Maybe there's something in the Omni libraries you could use, or some other open-source browser code. For Java I know there's something called TagSoup which a coworker has used very successfully.


On the other hand, I vaguely remember asking if NSXMLParser could be used with HTML that is not well-formed XML, and I *thought* the answer was yes, but I don't see how. I see there are delegate methods for handling errors, but the errors always seem to be fatal, which means you can't recover in some forgiving way.

--Andy

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Issue with NSXMLDocument and bad HTML (From: Tito Ciuro <email@hidden>)
 >Re: Issue with NSXMLDocument and bad HTML (From: Brian Stern <email@hidden>)
 >Re: Issue with NSXMLDocument and bad HTML (From: John Stiles <email@hidden>)

  • Prev by Date: Re: Nonbreaking spaces in alerts
  • Next by Date: How to Respond to a DoubleClick
  • Previous by thread: Re: Issue with NSXMLDocument and bad HTML
  • Next by thread: NSTask hangs on launch
  • Index(es):
    • Date
    • Thread