Sent: Thursday, March 22, 2018 9:51 AM
To: 'Ben Tupper'
Cc: 'r-help'
Subject: Re: [R] how to add a child to a child in XML
Just to clarify and hopefully catch the attention of the maintainer:
The newXMLNode function is not mentioned in:
https://cran.r-project.org/web/packag
, March 22, 2018 10:40 AM
To: Bond, Stephen
Cc: r-help
Subject: Re: [R] how to add a child to a child in XML
Hi,
It's a reasonable question. The answer is that it actually is included, but
there are many instances across packages where multiple functions are
documented on a single help page.
, 2018 6:18 PM
> To: Bond, Stephen
> Cc: r-help
> Subject: Re: [R] how to add a child to a child in XML
>
> Hi,
>
> XML doesn't use the `$` to access child nodes. Instead use either `[name]`
> to get a list of children of that name or `[[name]]` to get the just the
> f
: [R] how to add a child to a child in XML
Hi,
XML doesn't use the `$` to access child nodes. Instead use either `[name]` to
get a list of children of that name or `[[name]]` to get the just the first
child of that name encountered in the genealogy. Thus for your example...
> root$chi
Hi,
XML doesn't use the `$` to access child nodes. Instead use either `[name]` to
get a list of children of that name or `[[name]]` to get the just the first
child of that name encountered in the genealogy. Thus for your example...
> root$child1
NULL
> root[['child1']]
On the other hand,
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 <- addChildren(roo
6 matches
Mail list logo