EVOLUTION-MANAGER
Edit File: xmlSearchNs.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: Find a namespace definition object by searching ancestor...</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 xmlSearchNs {XML}"><tr><td>xmlSearchNs {XML}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Find a namespace definition object by searching ancestor nodes</h2> <h3>Description</h3> <p>This function allows one to search an XML tree from a particular node and find the namespace definition for a given namespace prefix or URL. This namespace definition can then be used to set it on a node to make it the effective namespace for that node. </p> <h3>Usage</h3> <pre> xmlSearchNs(node, ns, asPrefix = TRUE, doc = as(node, "XMLInternalDocument")) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>node</code></td> <td> <p>an <code>XMLInternaElementNode</code></p> </td></tr> <tr valign="top"><td><code>ns</code></td> <td> <p>a character string (vector of length 1). If <code>asPrefix</code> is <code>TRUE</code>, this is the namespace alias/prefix. If <code>asPrefix</code> is <code>FALSE</code>, this is the URL of the namespace definition</p> </td></tr> <tr valign="top"><td><code>asPrefix</code></td> <td> <p>a logical value. See <code>ns</code>.</p> </td></tr> <tr valign="top"><td><code>doc</code></td> <td> <p>the XML document in which the node(s) are located</p> </td></tr> </table> <h3>Value</h3> <p>An object of class XMLNamespaceRef. </p> <h3>Author(s)</h3> <p>Duncan Temple Lang </p> <h3>References</h3> <p>libxml2 </p> <h3>See Also</h3> <p><code><a href="newXMLDoc.html">newXMLNode</a></code> </p> <h3>Examples</h3> <pre> txt = '<top xmlns:r="http://www.r-project.org"><section><bottom/></section></top>' doc = xmlParse(txt) bottom = xmlRoot(doc)[[1]][[1]] xmlSearchNs(bottom, "r") </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>