saveXML.XMLInternalXSLTDocument | R Documentation |
This method for saveXML
writes the XML document stored in the
XMLInternalXSLTDocument
object either to a file or to an S string (character vector of length 1).
## S3 method for class 'XMLInternalXSLTDocument'
saveXML(doc, file = NULL, compression = 0,
indent = TRUE, prefix = "<?xml version=\"1.0\"?>\n",
doctype = NULL, encoding = "", ...)
doc |
an object of (S3-style) class
|
file |
if non- |
compression |
an integer value between 0 and 9 giving the
compression level to use when writing the XML to a file.
This is ignored if |
indent |
ignored, but here for compatability with the
|
prefix |
inherited from the generic function definition and ignored |
doctype |
inherited from the generic function definition and ignored |
encoding |
the character string giving the choice of encoding, e.g. "UTF-8", "Latin1". |
... |
additional parameters pased to methods |
This does not use the same mechanism for serializing a XML document as is used in the XML package.
If file
is NULL
, the
result is an S string containing the document.
If file
is the name of a file,
TRUE
is returned if the serialization was successful.
Otherwise and error is thrown.
In the future, this can be made to support S connections.
Duncan Temple Lang <duncan@wald.ucdavis.edu>
http://www.omegahat.org/Sxslt, http://www.omegahat.org/SXalan, http://www.w3.org/Style/XSL http://xmlsoft.org/XSLT htt
saveXML
xsltApplyStyleSheet
xsltParseStyleSheet
library(XML)
doc <- xsltApplyStyleSheet(system.file("examples", "register.xml", package = "Sxslt"),
system.file("examples", "register.xsl", package = "Sxslt"), FALSE)
cat(saveXML(doc))
outFile <- tempfile()
saveXML(doc$doc, outFile)
# to an R string
saveXML(doc)
## Not run:
# These files won't exist. Will fix up the example soon!
sheet <- xsltParseStyleSheet("../../../Literate/fragment.xsl")
doc <- xsltApplyStyleSheet("../../../RSXMLObjects/Src/writeRS.xml", sheet)
cat(saveXML(doc))
saveXML(doc, "/tmp/foo.xml")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.