r-lib / xml2

Bindings to libxml2
https://xml2.r-lib.org/
Other
220 stars 82 forks source link

?xml_add_child needs examples #434

Open MichaelChirico opened 11 months ago

MichaelChirico commented 11 months ago

I'm trying to use xml_add_child() for the first time, and don't know how to use it. It's clear it should take an XML object and a new child as input, but how exactly should they be structured? Can I pass text as the child, or does it need to be an XML object?

I consulted the docs, where I was met with:

xml_add_child(.x, .value, ..., .where = length(xml_children(.x)), .copy = TRUE) .value: node to insert.

And no examples. Not very helpful.