EVOLUTION-MANAGER
Edit File: xmlApply.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Applies a function to each of the children of an XMLNode</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for xmlApply {XML}"><tr><td>xmlApply {XML}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Applies a function to each of the children of an XMLNode</h2> <h3>Description</h3> <p>These methods are simple wrappers for the <code><a href="../../base/html/lapply.html">lapply</a></code> and <code><a href="../../base/html/lapply.html">sapply</a></code> functions. They operate on the sub-nodes of the XML node, and not on the fields of the node object itself. </p> <h3>Usage</h3> <pre> xmlApply(X, FUN, ...) ## S3 method for class 'XMLNode' xmlApply(X, FUN, ...) ## S3 method for class 'XMLDocument' xmlApply(X, FUN, ...) ## S3 method for class 'XMLDocumentContent' xmlApply(X, FUN, ...) xmlSApply(X, FUN, ...) ## S3 method for class 'XMLNode' xmlSApply(X, FUN, ...) ## S3 method for class 'XMLDocument' xmlSApply(X, FUN, ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>X</code></td> <td> <p>the <code>XMLNode</code> on whose children the regular <code><a href="../../base/html/apply.html">apply</a></code> or <code><a href="../../base/html/lapply.html">sapply</a></code> is to be performed</p> </td></tr> <tr valign="top"><td><code>FUN</code></td> <td> <p>the function to apply to each child node. This is passed directly to the relevant <code><a href="../../base/html/apply.html">apply</a></code> function.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>additional arguments to be given to each invocation of <code>FUN</code>. This is passed directly to the relevant <code><a href="../../base/html/apply.html">apply</a></code> function.</p> </td></tr> </table> <h3>Value</h3> <p>The result is that obtained from calling the <code><a href="../../base/html/apply.html">apply</a></code> or <code><a href="../../base/html/lapply.html">sapply</a></code> on <code>xmlChildren(x)</code>. </p> <h3>Author(s)</h3> <p>Duncan Temple Lang</p> <h3>References</h3> <p><a href="http://www.w3.org/XML">http://www.w3.org/XML</a>, <a href="http://www.jclark.com/xml">http://www.jclark.com/xml</a>, <a href="http://www.omegahat.net">http://www.omegahat.net</a> </p> <h3>See Also</h3> <p><code><a href="xmlChildren.html">xmlChildren</a></code> <code><a href="xmlRoot.html">xmlRoot</a></code> <code><a href="xmlSubset.html">[.XMLNode</a></code> <code><a href="../../base/html/lapply.html">sapply</a></code> <code><a href="../../base/html/lapply.html">lapply</a></code> </p> <h3>Examples</h3> <pre> doc <- xmlTreeParse(system.file("exampleData", "mtcars.xml", package="XML")) r <- xmlRoot(doc) xmlSApply(r[[2]], xmlName) xmlApply(r[[2]], xmlAttrs) xmlSApply(r[[2]], xmlSize) </pre> <hr /><div style="text-align: center;">[Package <em>XML</em> version 3.99-0.3 <a href="00Index.html">Index</a>]</div> </body></html>