[squeak-dev] Interesting retrieval error with XMLDOMParser

gettimothy gettimothy at zoho.com
Wed Sep 22 20:29:54 UTC 2021

Hi Folks,

No biggie, just interesting...

    |tree url |

    url := 'https://w1.weather.gov/xml/current_obs/index.xml'.

    tree := (XMLDOMParser on:  (HTTPLoader default retrieveContentsFor: url) contents

    ) parseDocument.

    tree explore.

(XMLDOMParser onURL: 'https://w1.weather.gov/xml/current_obs/index.xml') parseDocument; explore.  "throws an error"

The first form works on squeak.

The latter form works on pharo.

The latter does NOT Squeak because the XMLHTTPException: Forbidden (403) error gets thrown.

It is interesting that a platform difference would cause that error.

No biggie, but I would like to include a common retrieval method for both platforms in the XPathHelp (May turn it into a book down the road,too)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20210922/c86a7b45/attachment.html>

More information about the Squeak-dev mailing list