Learn R Programming

XML (version 3.99-0.16.1)

names.XMLNode: Get the names of an XML nodes children.

Description

This is a convenient way to obtain the XML tag name of each of the sub-nodes of a given XMLNode object.

Usage

# S3 method for XMLNode
names(x)

Value

A character vector returning the tag names of the sub-nodes of the given XMLNode argument.

Arguments

x

the XMLNode whose sub-node tag names are being queried.

Author

Duncan Temple Lang

References

https://www.w3.org/XML//, http://www.jclark.com/xml/, https://www.omegahat.net

See Also

xmlApply xmlSApply

Examples

Run this code
 doc <- xmlTreeParse(system.file("exampleData", "mtcars.xml", package="XML"))
 names(xmlRoot(doc))

 r <- xmlRoot(doc)
 r[names(r) == "variables"]

Run the code above in your browser using DataLab