xmlElementsByTagName(el, name, recursive = FALSE)
el
's children.FALSE
, the
default, only the direct child nodes are searched.
Alternatively, if this is TRUE
, all sub-nodes
at all levels are searched. In other words,
we find all descendants of the el
whose
tag name matches that specified by the user.recursive
is TRUE
, then the function is applied
recursively to the children of the given node and so on.xmlChildren
xmlTreeParse
doc <- xmlTreeParse("http://www.omegahat.org/Scripts/Data/mtcars.xml")
xmlElementsByTagName(doc$children[[1]], "variable")
doc <- xmlTreeParse(system.file("exampleData", "mtcars.xml", package="XML"))
xmlElementsByTagName(xmlRoot(doc)[[1]], "variable")
Run the code above in your browser using DataLab