Learn R Programming

XML (version 3.99-0.5)

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)

Arguments

x

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

Value

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

References

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

See Also

xmlApply xmlSApply

Examples

Run this code
# NOT RUN {
 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