EVOLUTION-MANAGER
Edit File: print.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: Methods for displaying XML objects</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 print.XMLAttributeDef {XML}"><tr><td>print.XMLAttributeDef {XML}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Methods for displaying XML objects</h2> <h3>Description</h3> <p>These different methods attempt to provide a convenient way to display R objects representing XML elements when they are printed in the usual manner on the console, files, etc. via the <code><a href="../../base/html/print.html">print</a></code> function. Each typically outputs its contents in the way that they would appear in an XML document. </p> <h3>Usage</h3> <pre> ## S3 method for class 'XMLNode' print(x, ..., indent= "", tagSeparator = "\n") ## S3 method for class 'XMLComment' print(x, ..., indent = "", tagSeparator = "\n") ## S3 method for class 'XMLTextNode' print(x, ..., indent = "", tagSeparator = "\n") ## S3 method for class 'XMLCDataNode' print(x, ..., indent="", tagSeparator = "\n") ## S3 method for class 'XMLProcessingInstruction' print(x, ..., indent="", tagSeparator = "\n") ## S3 method for class 'XMLAttributeDef' print(x, ...) ## S3 method for class 'XMLElementContent' print(x, ...) ## S3 method for class 'XMLElementDef' print(x, ...) ## S3 method for class 'XMLEntity' print(x, ...) ## S3 method for class 'XMLEntityRef' print(x, ..., indent= "", tagSeparator = "\n") ## S3 method for class 'XMLOrContent' print(x, ...) ## S3 method for class 'XMLSequenceContent' print(x, ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>the XML object to be displayed</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>additional arguments for controlling the output from print. Currently unused.</p> </td></tr> <tr valign="top"><td><code>indent</code></td> <td> <p>a prefix that is emitted before the node to indent it relative to its parent and child nodes. This is appended with a space at each succesive level of the tree. If no indentation is desired (e.g. when <code><a href="xmlTreeParse.html">xmlTreeParse</a></code> is called with <code>trim</code> and <code>ignoreBlanks</code> being <code>FALSE</code>) and <code>TRUE</code> respectively, one can pass the value <code>FALSE</code> for this <code>indent</code> argument. </p> </td></tr> <tr valign="top"><td><code>tagSeparator</code></td> <td> <p>when printing nodes, successive nodes and children are by default displayed on new lines for easier reading. One can specify a string for this argument to control how the elements are separated in the output. The primary purpose of this argument is to allow no space between the elements, i.e. a value of <code>""</code>. </p> </td></tr> </table> <h3>Value</h3> <p>Currently, <code>NULL</code>. </p> <h3>Note</h3> <p>We could make the node classes self describing with information about whether <code>ignoreBlanks</code> was <code>TRUE</code> or <code>FALSE</code> and if trim was TRUE or FALSE. This could then be used to determine the appropriate values for <code>indent</code> and <code>tagSeparator</code>. Adding an S3 class element would allow this to be done without the addition of an excessive number of classes. </p> <h3>Author(s)</h3> <p>Duncan Temple Lang</p> <h3>References</h3> <p><a href="http://www.w3.org">http://www.w3.org</a>, <a href="http://www.omegahat.net/RSXML">http://www.omegahat.net/RSXML</a></p> <h3>See Also</h3> <p><code><a href="xmlTreeParse.html">xmlTreeParse</a></code> </p> <h3>Examples</h3> <pre> fileName <- system.file("exampleData", "event.xml", package ="XML") # Example of how to get faithful copy of the XML. doc = xmlRoot(xmlTreeParse(fileName, trim = FALSE, ignoreBlanks = FALSE)) print(doc, indent = FALSE, tagSeparator = "") # And now the default mechanism doc = xmlRoot(xmlTreeParse(fileName)) print(doc) </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>