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

Duncan Temple Lang duncan at wald.ucdavis.edu
Tue Mar 20 22:55:34 CET 2007


Just for the record,  the method has been added for that particular
type of tree. So the original

  saveXML(tt, file = "test.xml")

will work.

Thanks for pointing it out.

 D.



Alberto Monteiro wrote:
> 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
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list