SxsltInitializationFunction: Set an R function to be called each time the R extension...

Description Usage Arguments Value Author(s) References See Also


This function allows the R user to specify an R function that is called each time the XSLT extension module for R is initialized. This happens each time the extension is referenced within an XSL style sheet that is being applied to an XML document. This provides an opportunity for R to perform some additional computations. Typically, the function registers any R functions that should be made available to the extension as extension functions. However, other computations can be performed.

When the package is loaded, a default function (Sxslt:::defaultXSLTInitialization) is set as the initialization function. That handles registering functions queued with the addXSLTFunctions function also in this package.





an R function which will be called each time the XSLT extension module is initialized. This function will be called with two arguments: a character vector of length 1 (i.e. a string) which identifies the URI of the extension, and an reference to the XSLT parser context. This is an opaque data type that can be used in calls to registerXSLFunction as the context argument.


This returns the previously registered R function that was used for handling the initialization of the extension module. This allows one to save the value and restore it after applying a stylesheet to a particular document or set of documents.


Duncan Temple Lang <[email protected]>


registration.R in the examples/ directory.

See Also

registerXSLFunction addXSLTFunctions

sckott/sxslt documentation built on May 26, 2017, 3:49 a.m.