names.XMLNode | R Documentation |
This is a convenient way to obtain the XML tag name
of each of the sub-nodes of a given
XMLNode
object.
## S3 method for class 'XMLNode'
names(x)
x |
the |
A character vector returning the
tag names of the sub-nodes of the given
XMLNode
argument.
This overrides the regular names method
which would display the names of the internal
fields of an XMLNode
object.
Since these are intended to be invisible and
queried via the accessor methods (xmlName
,
xmlAttrs
, etc.), this should not
be a problem. If you really need the names
of the fields, use names(unclass(x))
.
Duncan Temple Lang
https://www.w3.org/XML//, http://www.jclark.com/xml/, https://www.omegahat.net
xmlApply
xmlSApply
doc <- xmlTreeParse(system.file("exampleData", "mtcars.xml", package="XML"))
names(xmlRoot(doc))
r <- xmlRoot(doc)
r[names(r) == "variables"]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.