takes xml_name, xml_children and xml_attributes to create a new xml_node.
Usage
xml_node_create(
xml_name,
xml_children = NULL,
xml_attributes = NULL,
escapes = FALSE,
declaration = FALSE
)
Examples
xml_name <- "a"
# "<a/>"
xml_node_create(xml_name)
#> [1] "<a/>"
xml_child <- "openxlsx"
# "<a>openxlsx</a>"
xml_node_create(xml_name, xml_children = xml_child)
#> [1] "<a>openxlsx</a>"
xml_attr <- c(foo = "baz", qux = "quux")
# "<a foo=\"baz\" qux=\"quux\"/>"
xml_node_create(xml_name, xml_attributes = xml_attr)
#> [1] "<a foo=\"baz\" qux=\"quux\"/>"
# "<a foo=\"baz\" qux=\"quux\">openxlsx</a>"
xml_node_create(xml_name, xml_children = xml_child, xml_attributes = xml_attr)
#> [1] "<a foo=\"baz\" qux=\"quux\">openxlsx</a>"