xmlName.RdEach XMLNode object has an element or tag name introduced
in the <name ...> entry in an XML document.
This function returns that name.
We can also set that name using xmlName(node) <- "name"
and the value can have an XML name space prefix, e.g.
"r:name".
xmlName(node, full = FALSE)A character vector of length 1
which is the node$name entry.
fileName <- system.file("exampleData", "test.xml", package="XML")
doc <- xmlTreeParse(fileName)
xmlName(xmlRoot(doc)[[1]])
#> [1] "element"
tt = xmlRoot(doc)[[1]]
xmlName(tt)
#> [1] "element"
xmlName(tt) <- "bob"
# We can set the node on an internal object also.
n = newXMLNode("x")
xmlName(n)
#> [1] "x"
xmlName(n) <- "y"
xmlName(n) <- "r:y"