[R] RSXML - Parsing XML Documents on Internet

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu Sep 30 08:52:08 CEST 2004


On Wed, 29 Sep 2004 larsenmtl at comcast.net wrote:

> 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.  

That's your problem.  You can use proxies without --internet2 (see 
?download.file) and 

> 
> 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-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
> 
> 

-- 
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




More information about the R-help mailing list