Learn R Programming

XML (version 0.9-0)

saveXML: Output internal XML Tree

Description

Methods for writing the representation of an XML tree stored in internal memory to a string or file.

Usage

saveXML(doc, file=NULL, compression=0, indent=T)
saveXML.XMLInternalDocument(doc, file=NULL, compression=0, indent=T)
saveXML.XMLInternalDOM(doc, file=NULL, compression=0, indent=T)

Arguments

doc
the document object representing the XML document.
file
the name of the file to which the contents of the XML nodes will be serialized.
compression
an integer value between 0 and 9 indicating the level of compression to use when saving the file. Higher values indicate increased compression and hence smaller files at the expense of computational time to do the compression and decompression
indent
a logical value indicating whether to indent the nested nodes when serializing to the stream.

Value

    Details

    One can create an internal XML tree (or DOM) using newXMLDoc and newXMLNode. saveXML allows one to generate a textual representation of that DOM in human-readable and reusable XML format. saveXML is a generic function that allows one to call the rendering operation with either the top-level node of the DOM or of the document object (of class XMLInternalDocument that is used to accumulate the nodes and with which the developer adds nodes.

    References

    http://www.w3.org/XML, http://www.omegahat.org/RSXML

    See Also

    newXMLDoc newXMLNode xmlOutputBuffer xmlOutputDOM