Displaying 5 results from an estimated 5 matches for "atts_grandchild".
2018 Mar 21
0
how to add a child to a child in XML
...ot) <- c("att1","att2","att3")
root <- newXMLNode("root", attrs = atts_root)
atts_child <- LETTERS[1:3]
names(atts_child) <- paste("name",1:3,sep="")
child <- newXMLNode("child",attrs = atts_child, parent = root)
atts_grandchild <- letters[1:3]
names(atts_grandchild) <- paste("name",4:6,sep="")
grandchild <- newXMLNode("grandchild",attrs = atts_grandchild, parent = child)
root
#<root att1="val1" att2="val2" att3="val3">
# <child name1="A&q...
2018 Mar 22
2
how to add a child to a child in XML
...ot) <- c("att1","att2","att3")
root <- newXMLNode("root", attrs = atts_root)
atts_child <- LETTERS[1:3]
names(atts_child) <- paste("name",1:3,sep="")
child <- newXMLNode("child",attrs = atts_child, parent = root)
atts_grandchild <- letters[1:3]
names(atts_grandchild) <- paste("name",4:6,sep="")
grandchild <- newXMLNode("grandchild",attrs = atts_grandchild, parent = child)
root
#<root att1="val1" att2="val2" att3="val3">
# <child name1="A&q...
2018 Mar 21
2
how to add a child to a child in XML
I am trying to add a child to a child using XML package in R. the following fails
library(XML)
node1 <- c("val1","val2","val3")
names(node1) <- c("att1","att2","att3")
root <- xmlNode("root", attrs=node1)
node2 <- LETTERS[1:3]
names(node2) <- paste("name",1:3,sep="")
root <-
2018 Mar 22
0
how to add a child to a child in XML
...t2","att3")
> root <- newXMLNode("root", attrs = atts_root)
>
> atts_child <- LETTERS[1:3]
> names(atts_child) <- paste("name",1:3,sep="")
> child <- newXMLNode("child",attrs = atts_child, parent = root)
>
> atts_grandchild <- letters[1:3]
> names(atts_grandchild) <- paste("name",4:6,sep="")
> grandchild <- newXMLNode("grandchild",attrs = atts_grandchild, parent = child)
>
> root
> #<root att1="val1" att2="val2" att3="val3">
&g...
2018 Mar 22
1
how to add a child to a child in XML
...ot) <- c("att1","att2","att3")
root <- newXMLNode("root", attrs = atts_root)
atts_child <- LETTERS[1:3]
names(atts_child) <- paste("name",1:3,sep="")
child <- newXMLNode("child",attrs = atts_child, parent = root)
atts_grandchild <- letters[1:3]
names(atts_grandchild) <- paste("name",4:6,sep="")
grandchild <- newXMLNode("grandchild",attrs = atts_grandchild, parent = child)
root
#<root att1="val1" att2="val2" att3="val3">
# <child name1="A&q...