xmlElementsByTagName {XML} | R Documentation |
This returns a list of the children or sub-elements of an XML node whose tag name matches the one specified by the user.
xmlElementsByTagName(el, name)
el |
the node whose matching children are to be retrieved. |
name |
a string giving the name of the tag to match in each of
el 's children. |
This does a simple matching of names and subsets the XML node's children list.
A list containing those child nodes of el
whose
tag name matches that specified by the user.
Duncan Temple Lang
http://www.w3.org/XML, http://www.omegahat.org/RSXML,
## Not run: doc <- xmlTreeParse("http://www.omegahat.org/Scripts/Data/mtcars.xml") xmlElementsByTagName(doc$children[[1]], "variable") ## End(Not run) doc <- xmlTreeParse(system.file("exampleData", "mtcars.xml", package="XML")) xmlElementsByTagName(xmlRoot(doc)[[1]], "variable")