R Users - I asked about this a few months ago and never did quite figure it out, so with more information, allow me to try again. If I use the following code: library(xml) xmlTreeParse("http://home.comcast.net/~larsenmtl/xmlTestDoc.xml", isURL = TRUE) I receive this error: Error in xmlTreeParse("http://home.comcast.net/~larsenmtl/xmlTestDoc.xml"", : error in creating parser for http://home.comcast.net/~larsenmtl/xmlTestDoc.xml" Now I know that xmlTreeParse uses the libxml facilities for downloading and parsing off the web. Along with one of our network people, I did some packet sniffing and it looks like libxml doesn't go through our proxy server (it tries to directly connect to the above URL), which is the reason for the error. Is there anyway to force it through the proxy? Am I missing some setting or option? If I download the xml file and parse it locally it works without error. Please Note that the URL is valid and I can open it in my browser. Also note that I must start R with the --internet2 option so it'll use our proxy server. Details: Windows 2000 R1.9.1 RSXML 0.97-0 libxml2-2.4.13 distribution for Windows I also tried this on a Mandrake 9.2 box with R1.9.1, XML0.95-6, and libxml2 2.6.13. Results were the same but with the additional error message: I/O warning: falied to load external entity "http://...." Thanks, Mark Larsen
R Users - I asked about this a few months ago and never did quite figure it out, so with more information, allow me to try again. If I use the following code: library(xml) xmlTreeParse("http://home.comcast.net/~larsenmtl/xmlTestDoc.xml", isURL = TRUE) I receive this error: Error in xmlTreeParse("http://home.comcast.net/~larsenmtl/xmlTestDoc.xml"", : error in creating parser for http://home.comcast.net/~larsenmtl/xmlTestDoc.xml" Now I know that xmlTreeParse uses the libxml facilities for downloading and parsing off the web. Along with one of our network people, I did some packet sniffing and it looks like libxml doesn't go through our proxy server (it tries to directly connect to the above URL), which is the reason for the error. Is there anyway to force it through the proxy? Am I missing some setting or option? If I download the xml file and parse it locally it works without error. Please Note that the URL is valid and I can open it in my browser. Also note that I must start R with the --internet2 option so it'll use our proxy server. Details: Windows 2000 R1.9.1 RSXML 0.97-0 libxml2-2.4.13 distribution for Windows I also tried this on a Mandrake 9.2 box with R1.9.1, XML0.95-6, and libxml2 2.6.13. Results were the same but with the additional error message: I/O warning: falied to load external entity "http://...." Thanks, Mark Larsen
Professors Ripley and Lang, Thanks. Your fix was dead-on, setting the env var http_proxy solved my problem. Mark> Sorry, my flaky connection (I am on a slow dialup) broke this up: here's > the rest. > > On Thu, 30 Sep 2004, Prof Brian Ripley wrote: > > > On Wed, 29 Sep 2004 larsenmtl at comcast.net wrote: > > [...] > > > > Now I know that xmlTreeParse uses the libxml facilities for downloading and > > > parsing off the web. Along with one of our network people, I did some > packet > > > sniffing and it looks like libxml doesn't go through our proxy server (it > tries > > > to directly connect to the above URL), which is the reason for the error. > Is > > > there anyway to force it through the proxy? Am I missing some setting or > > > option? If I download the xml file and parse it locally it works without > error. > > > > > > Please Note that the URL is valid and I can open it in my browser. Also > note > > > that I must start R with the --internet2 option so it'll use our proxy > server. > > > > That's your problem. You *can* use proxies without --internet2 (see > > ?download.file) and the XML code uses the standard version of the code. > > The first issue is that you have not configured R to use your proxy, so > please get that working. > > Issue two is that you may need to get an older version of XML compiled > against an older libxml, as the current one has not been tested. > > -- > Brian D. Ripley, ripley at stats.ox.ac.uk > Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ > University of Oxford, Tel: +44 1865 272861 (self) > 1 South Parks Road, +44 1865 272866 (PA) > Oxford OX1 3TG, UK Fax: +44 1865 272595 >