'externalptr' error in R using XML data 'externalptr' error in R using XML data xml xml

'externalptr' error in R using XML data


The XML package works by making pointer document of the XML document your trying to manipulate.

The 'externalptr' are simply external pointers to the data within the xml document.

To access the data you need to use

Parsed.xml <- xmlTreeParse(xml) ## should be string with xml text## get value of the first nodexmlValue(xml[[1]])## get value of the third grandchild of the first nodexmlValue(xml[[1]][[45]][[3]])   

You need to access each node of the xml as a list.


I managed to write the content of an XML tree to a file using the saveXML() command from the XML package:

saveXML(xml[[1]], file="output.xml")

Hope this helps.


I know this is an old thread, but to understand in detail about external pointer I feel it is important to understand when it is used. This thread tells the difference between xmlParse and xmlTreeParse, when to use it, and how it works (pointer vs object).