What's wrong with this?
library(XML)
tt <- xmlHashTree()
head <- addNode(xmlNode("head"), character(), tt)
test <- addNode(xmlNode("test", attrs=c(pi="4")), head,
tt)
tt # ok
saveXML(tt, file="test.xml") # error
The error (in Portuguese) is:
Erro em saveXML(tt, file = "test.xml") : nenhum m?todo aplic?vel
para "saveXML"
which could translate to
Error in saveXML(tt, file = "test.xml") : no method applicable to
"saveXML"
Alberto Monteiro
I wrote:> > library(XML) > tt <- xmlHashTree() > head <- addNode(xmlNode("head"), character(), tt) > test <- addNode(xmlNode("test", attrs=c(pi="4")), head, tt) > tt # ok > saveXML(tt, file="test.xml") # error >I found a way to circumvent this error, by replacing the saveXML line with: sink("test.xml") print(tt) sink() Alberto Monteiro