[R] XML - can create but can't save

Alberto Monteiro albmont at centroin.com.br
Tue Mar 20 13:09:50 CET 2007


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



More information about the R-help mailing list