[Haskell-cafe] HXT/Practical/Weather.hs difficulties

Brian Troutwine goofyheadedpunk at gmail.com
Tue Nov 4 20:50:20 EST 2008


Oh my, how silly of me. The page has moved to
http://www.weather.gov/xml/current_obs/KAGC.xml ! Firefox simply
follows the redirect.

Thanks for the putStrLn suggestion, George.

On Tue, Nov 4, 2008 at 5:28 PM, George Pollard <porges at porg.es> wrote:
> On Tue, 2008-11-04 at 17:04 -0800, Brian Troutwine wrote:
>> > blt at doritos:~
>> > $ ./weather
>> >
>> > error: ""<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0/..."" (line 1, column 16):
>> > unexpected "P"
>> > expecting white space, "[" or ">"
>> >
>> > Unable to parse weather data.
>>
>> Woops. Would someone be so kind as to explain why this is failing? I'm
>> at rather a loss.
>
> The HXT parser is stopping because it's expecting XML not HTML, which is
> what you're receiving for some reason.
>
> I just loaded up the weather URL in Firefox
> [http://www.weather.gov/xml/current_obs/KAGC.xml] and it is XML... Is it
> possible that you are behind a proxy that is blocking the page? (I can't
> run the code at the moment; cleaning out Haskell packages to upgrade to
> 6.10.)
>
> You could try printing out the contents of the page as well (putStrLn
> doc) so you can see the rest of the HTML that `weather` is receiving.
>



-- 
Brian


More information about the Haskell-Cafe mailing list