
Last chance! 50% off unlimited learning
Sale ends in
These methods are simple wrappers for the
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, ...)
# S3 method for XMLNode
xmlApply(X, FUN, ...)
# S3 method for XMLDocument
xmlApply(X, FUN, ...)
# S3 method for XMLDocumentContent
xmlApply(X, FUN, ...)
xmlSApply(X, FUN, ...)
# S3 method for XMLNode
xmlSApply(X, FUN, ...)
# S3 method for XMLDocument
xmlSApply(X, FUN, ...)
the function to apply to each child node. This is passed
directly to the relevant apply
function.
additional arguments to be given to each invocation of
FUN
. This is passed directly to the relevant apply
function.
The result is that obtained from calling
the apply
or sapply
on xmlChildren(x)
.
http://www.w3.org/XML, http://www.jclark.com/xml, http://www.omegahat.net
# NOT RUN {
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