
Last chance! 50% off unlimited learning
Sale ends in
lapply
and sapply
functions.
They operate on the
sub-nodes of the XML node,
and not on the fields of the node object itself.xmlApply(X, FUN, ...)
xmlApply.XMLNode(X, FUN, ...)
xmlApply.XMLDocument(X, FUN, ...)
xmlApply.XMLDocumentContent(X, FUN, ...)
xmlSApply(X, FUN, ...)
xmlSApply.XMLNode(X, FUN, ...)
xmlSApply.XMLDocument(X, FUN, ...)
apply
function.FUN
. This is passed directly to the relevant apply
function.lapply
xmlChildren
xmlRoot
[.XMLNode
doc <- xmlTreeParse(system.file("exampleData", "mtcars.xml", package="XML"))
r <- xmlRoot(doc)
xmlSApply(r[[2]], xmlName)
xmlApply(r[[2]], xmlAttrs)
xmlSApply(r[[2]], xmlSize)
Run the code above in your browser using DataLab