[R] Parsing a XML file

Gavin Simpson gavin.simpson at ucl.ac.uk
Wed Aug 25 00:02:35 CEST 2010


On Tue, 2010-08-24 at 23:35 +0200, Orvalho Augusto wrote:
> I have one XML file with 30MB that I need to read the data.
> 
> I try this;
> library(XML)
> doc <- xmlDoc("Malaria_Grave.xml")
> 
> And R answers like this
>  *** caught segfault ***
> address 0x5, cause 'memory not mapped'

This is most likely a bug in your version (unstated) of the XML package.
But it may be a problem with the file, though XML shouldn't crash R.
Make sure you are using the latest version of the XML package and R is
up-to-date, then retry your code in a new R session. If it still
segfaults, you need to file a bug report with the maintainer: Duncan
Temple Lang, and include all the relevant details such as output from

sessionInfo()

The .xml file you are trying to read and the code required to reproduce
the segfault.

HTH

G

> Traceback:
>  1: .Call("RS_XML_createDocFromNode", node, PACKAGE = "XML")
>  2: xmlDoc("Malaria_Grave.xml")
> 
> Possible actions:
> 1: abort (with core dump, if enabled)
> 2: normal R exit
> 3: exit R without saving workspace
> 4: exit R saving workspace
> 
> 
> Or I try this:
> doc <- xmlTreeParse("Malaria_Grave.xml")
> 
> I get this
> xmlParseEntityRef: no name
> xmlParseEntityRef: no name
> Error: 1: xmlParseEntityRef: no name
> 2: xmlParseEntityRef: no name
> 
> Please guys help this simple mortal!
> Caveman
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

-- 
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
 Dr. Gavin Simpson             [t] +44 (0)20 7679 0522
 ECRC, UCL Geography,          [f] +44 (0)20 7679 0565
 Pearson Building,             [e] gavin.simpsonATNOSPAMucl.ac.uk
 Gower Street, London          [w] http://www.ucl.ac.uk/~ucfagls/
 UK. WC1E 6BT.                 [w] http://www.freshwaters.org.uk
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%



More information about the R-help mailing list