xml2HTML | R Documentation |
These functions provide R-level facilities for processing an
XML/R-docbook document to HTML or PDF but without running
the code in the document, but merely displaying it as-is in the
document. (For dynamically running the code and inserting the results, use
dynDoc
.)
The xml2PDF
function attempts to use FOP to create the PDF from
the Formatting Object (FO) document.
The functions xml2HTML and rdh2HTML are identical, just with different names to indicate that they can be used for R-Docbook (rdb) files. The same applies to the PDF functions.
These are just convenience functions to do things from within R.
They currently do not specify all the useful XSL parameters to
control the creation of the document. A better way is to use
the make file that comes with this XDynDocs
package.
make -f <directory of installed XDynDocs package>/Make/Makefile myDoc.html
xml2HTML(file,
style = "http://www.omegahat.org/XDynDocs/XSL/OmegahatXSL/html/Rhtml.xsl",
..., out = gsub("\\.(Rdb|xml)$", "\\.html", file),
.params = XSL_DB_Opts)
file |
the source document, either a file or a parsed XML document |
style |
the XSL stylesheet |
... |
additional parameters passed on to |
out |
the name of the output file or |
.params |
an alternative way to specify XSL parameter name-value pairs as a list or character vector. |
Duncan Temple Lang
dynDoc
xsltApplyStyleSheet
in the XSL package.
doc = system.file("docs", "Rdocbook.xml", package = "XDynDocs")
xml2HTML(doc, out = "foo.html")
xml2PDF(doc, out = "foo.pdf")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.