<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta content="text/html;charset=UTF-8" http-equiv="Content-Type"></head><body ><div style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10pt;"><div>Hi Marcel.<br></div><div><br></div><div>It throws a Mal Formed Error on Squeak and on Pharo, the dependency on WebClient is not respected.<br></div><div><br></div><div>Thank you for trying, I appreciate the effort.<br></div><div><br></div><div>I am going to look deeper into the original error and see if I can fix it there.<br></div><div><br></div><div>The reason interop is important, is because it makes the Help portable and  I want to turn my work into a Pillar booklet as a first effort towards a full book on using the XML package on Squeak or Pharo.<br></div><div><br></div><div>Thanks again.<br></div><div><br></div><div>t</div><div><br></div><div><br></div><div><br></div><div class="zmail_extra_hr" style="border-top: 1px solid rgb(204, 204, 204); height: 0px; margin-top: 10px; margin-bottom: 10px; line-height: 0px;"><br></div><div class="zmail_extra" data-zbluepencil-ignore="true"><br><div id="Zm-_Id_-Sgn1">---- On Thu, 23 Sep 2021 04:59:19 -0400 <b>Marcel Taeumel <marcel.taeumel@hpi.de></b> wrote ----<br></div><br><blockquote style="margin: 0px;"><div><div id="x_-640524465__MailbirdStyleContent" style="font-size :  10pt; font-family :  Arial; color :  #000000; text-align :  left;" dir="ltr">Hi --<div><br></div><div>It would be nice to have a streamlined support for loading XML documents from URLs. I think that WebClient would be the way to go for HTTP downloads:<br></div><div><span class="size" style="font-size:13.3333px">(WebClient httpGet: '<a href="https://w1.weather.gov/xml/current_obs/index.xml')" target="_blank">https://w1.weather.gov/xml/current_obs/index.xml')</a> contentStream</span><br></div><div><span class="size" style="font-size:13.3333px"><br></span></div><div><span class="size" style="font-size:13.3333px">"XML-Parser" currently depends on "Files" because of SAXHandler class >> #parserOnFileNamed:. A dependency on "WebClient" might not hurt ... maybe through the "Tools" package? Hmmm...</span><br></div><div><span class="size" style="font-size:13.3333px"><br></span></div><div><span class="size" style="font-size:13.3333px">Well, I don't like the class-side interface of SAXHandler and XMLDOMParser. Instead, I prefer the reader/writer notion like this:</span><br></div><div><span class="size" style="font-size:13.3333px"><br></span></div><div>XMLDOMParser onFileNamed: '...'<br></div><div>XMLDOMParser onURL: '...'<br></div><div><span class="size" style="font-size:13.3333px"><br></span></div><div><span class="size" style="font-size:13.3333px">Considering the actual result, I like the interface of Form (for PNGs, JPEGs, etc.):</span><br></div><div><span class="size" style="font-size:13.3333px"><br></span></div><div>XMLDocument fromFileNamed: '...'<br></div><div><span class="size" style="font-size:13.3333px">XMLDocument fromURL: '...'</span><br></div><div><span class="size" style="font-size:13.3333px"><br></span></div><div><span class="size" style="font-size:13.3333px">Please find attached a change set that makes the proposed interface work in Squeak Trunk.</span><br></div><div><span class="size" style="font-size:13.3333px"><br></span></div><div><span class="size" style="font-size:13.3333px">Best,</span><br></div><div><span class="size" style="font-size:13.3333px">Marcel</span><br></div><div><span class="size" style="font-size:13.3333px"><br></span></div><div class="x_-640524465mb_sig"><br></div><blockquote class="x_-640524465history_container" style="border-left-style :  solid; border-width :  1px; margin-top :  20px; margin-left :  0px; padding-left :  10px; min-width :  500px;"><p style="margin-top: 10px;"><span class="colour" style="color: rgb(170, 170, 170); margin-top: 10px;">Am 22.09.2021 22:30:08 schrieb gettimothy via Squeak-dev <<a href="mailto:squeak-dev@lists.squeakfoundation.org" target="_blank">squeak-dev@lists.squeakfoundation.org</a>>:</span><br></p><div style="font-family :  Arial, Helvetica, sans-serif;"><div style="font-family :  Verdana,  Arial,  Helvetica,  sans-serif; font-size :  10pt;"><div>Hi Folks,<br></div><div><br></div><div>No biggie, just interesting...<br></div><div><br></div><div><br></div><div><blockquote style="border :  1px solid rgb(204, 204, 204); padding :  7px; background-color :  rgb(245, 245, 245); min-width :  500px;"><div>    |tree url |<br></div><div>    url := '<a target="_blank" href="https://w1.weather.gov/xml/current_obs/index.xml">https://w1.weather.gov/xml/current_obs/index.xml</a>'.<br></div><div>    tree := (XMLDOMParser on:  (HTTPLoader default retrieveContentsFor: url) contents<br></div><div>    ) parseDocument.<br></div><div>    tree explore.<br></div><div><br></div><div>(XMLDOMParser onURL: '<a target="_blank" href="https://w1.weather.gov/xml/current_obs/index.xml">https://w1.weather.gov/xml/current_obs/index.xml</a>') parseDocument; explore.  "throws an error"<br></div></blockquote><br></div><div><br></div><div>The first form works on squeak.<br></div><div>The latter form works on pharo.<br></div><div>The latter does NOT Squeak because the XMLHTTPException: Forbidden (403) error gets thrown.<br></div><div><br></div><div>It is interesting that a platform difference would cause that error.<br></div><div><br></div><div>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)<br></div><div><br></div><div>cheers.<br></div></div><br></div></blockquote></div><br></div></blockquote></div><div><br></div></div><br></body></html>