I would like to find the parent names of nodes that does not have any children. I tried my XPath expression on, for example, xpather.com and it works fine, but I cannot get it to work in R.
//*[not(*)]/parent::*/name()
The result should be aa, ca
library(XML)
xml_doc <- ("<ca>
<ai>67400000</ai>
<ssci>FN</ssci>
<aa>
<ta>1280</ta>
<tc>EUR</tc>
</aa>
</ca>")
xml_parsed <- xmlParse(xml_doc)
a <- getNodeSet(xml_parsed, "//*[not(*)]/parent::*")
names(a)