Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
13
Task/XML-Output/R/xml-output.r
Normal file
13
Task/XML-Output/R/xml-output.r
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
library(XML)
|
||||
char2xml <- function(names, remarks){
|
||||
tt <- xmlHashTree()
|
||||
head <- addNode(xmlNode("CharacterRemarks"), character(), tt)
|
||||
node <- list()
|
||||
for (i in 1:length(names)){
|
||||
node[[i]] <- addNode(xmlNode("Character", attrs=c(name=names[i])), head, tt)
|
||||
addNode(xmlTextNode(remarks[i]), node[[i]], tt)
|
||||
}
|
||||
return(tt)
|
||||
}
|
||||
output <- char2xml( names=c("April","Tam O'Shanter","Emily"),
|
||||
remarks=c("Bubbly: I'm > Tam and <= Emily", 'Burns: "When chapman billies leave the street ..."', "Short & shrift") )
|
||||
Loading…
Add table
Add a link
Reference in a new issue