Sxsltproc: R function mimicing shell command xsltproc

Description Usage Arguments Details Value Note Author(s) References See Also Examples

Description

This function (and its similarly named counterpart Rxsltproc) is an R function that provides a similar interface as the executable xsltproc. It is intended for use by an R script that implements the Sxsltproc command on Windows, Linux and OS X.

Note that the name of the XSL file preceeds the name of the XML file in the arguments. This is to mimic the call sequence of xsltproc. It is the reverse of xsltApplyStyleSheet.

Usage

1

Arguments

args

a character vector of command line arguments. This currently supports –param name value and –stringparam name value as three separate consecutive arguments. It also supports –output and -o to specify the output file name. If neither is specified, the output is sent to the console unless –noout is specified in which case no output is generated.

Details

This calls xsltApplyStyleSheet

Value

The value returned by outputting the result or the document itself if there is no output.

Note

Currently, we output the XML declaration <?xml version="1.0"?> regardless of whether it is desired or not, e.g. a text file being created, or if there is an XSL declaration that suppresses it.

Author(s)

Duncan Temple Lang

References

xsltproc at http://www.xmlsoft.org

See Also

xsltApplyStyleSheet

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
  # In the shell
 Sxsltproc tests/simple.xsl tests/simple.xml
 Sxsltproc --param foo "'123'" tests/simple.xsl tests/simple.xml
 Sxsltproc --stringparam foo "123" tests/simple.xsl tests/simple.xml
 
  # In R
 Sxsltproc(c("tests/simple.xsl", "tests/simple.xml"))
 Sxsltproc(c("--param", "foo", "'123'", "tests/simple.xsl", "tests/simple.xml"))

## End(Not run)

sckott/sxslt documentation built on May 29, 2019, 4:06 p.m.