'externalptr' error in R using XML data

前端 未结 3 1999
死守一世寂寞
死守一世寂寞 2021-02-05 13:01

I am working with some XML data in R and running into errors regarding type \'externalptr\'.

1) I get the following error when I try to use the xmlInternalTreeParse()

3条回答
  •  遇见更好的自我
    2021-02-05 13:51

    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 node
    xmlValue(xml[[1]])
    ## get value of the third grandchild of the first node
    xmlValue(xml[[1]][[45]][[3]])   
    

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

提交回复
热议问题