registerXSLTExtension: Register a new XSLT extension namespace

Description Usage Arguments Value Author(s) See Also Examples

Description

This function allows the R programmer to declare a new XSLT extension namespace. One can either register functions for this extension in this call or via subsequent direct calls to registerXSLTFunctions.

Usage

1

Arguments

ns

the namespace's URI. This can also be given in the form c(prefix = "http:...") and then the value of prefix can be used to identify the extension in calls to registerXSLTFunctions via its .namespace parameter.

...

name = function pairs of functions that are to be registered for this XSL extension and made available each time an XSL processor is activated.

.funcs

this is an alternative form of specifying the collection of name = function pairs which is more convenient when these functions are already in list form. The ... approach is useful for "interactive" use, i.e. when the functions are known when the command is written.

Value

TRUE! It is the side-effect of creating a registry for this namespace that it is of interest.

Author(s)

Duncan Temple Lang

See Also

addXSLTFunctions

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
 library(XML)  # for xmlValue
 e = new.env()
 omgEval = function(node) {
    eval(parse(text = xmlValue(node)), e)
 }
 environment(omgEval) = e

 registerXSLTExtension(c("omg" = "http://www.omegahat.org"),
                       eval = omgEval)
  # now  any XSL file can call omg:eval() by
  #  declaring the namespace http://www.omegahat.org
  #  and adding it to the extension-element-prefixes
  #  

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