• 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: Brian Stern <email@hidden>
  • Date: Tue, 18 Oct 2005 15:48:56 -0400

>I'm trying to load an HTML page as an XML object like this:
>
>> NSURL *url = [NSURL URLWithString:@"http://wwwa.accuweather.com/
>> forecast.asp?zipcode=94025&partner=accuweather"]];
>> NSXMLDocument *xml = [[[NSXMLDocument alloc]
>> initWithContentsOfURL:url options:NSXMLDocumentTidyXML
>> error:anError]autorelease];
>
>The page seems to be malformed, so the NSXMLDocument becomes nil and
>'anError' contains a lot of errors:
>
>> NSError "line 78 column 26 - Warning: unescaped & or unknown entity
>> "&city"

The page isn't malformed.  All those ampersands are inside string constants
in javascript that's on that page.  You probably need to download the page
and remove all the javascript content before passing it to NSXMLDocument.

--
Brian  Stern
email@hidden
 _______________________________________________
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

  • Follow-Ups:
    • Re: Issue with NSXMLDocument and bad HTML
      • From: John Stiles <email@hidden>
References: 
 >Issue with NSXMLDocument and bad HTML (From: Tito Ciuro <email@hidden>)

  • Prev by Date: Re: How to create an indexed color PNG file
  • Next by Date: Re: Nonbreaking spaces in alerts
  • Previous by thread: Re: Issue with NSXMLDocument and bad HTML
  • Next by thread: Re: Issue with NSXMLDocument and bad HTML
  • Index(es):
    • Date
    • Thread