xsltGetCurrentTemplate: Query the active node or template

Description Usage Arguments Value Author(s) References See Also

Description

These functions allow the R programmer to query which XML node or XSL template is currently active, i.e. being processed. These can be useful for debugging purposes but also for being able to fetch the template and apply it to other nodes or when the R function needs more information about the node than was supplied by the XSL call to the R function. This last situation indicates sub-optimal XSL programming.

Usage

1
2

Arguments

ctx

the XSLT proccessing context that is in effect for performing the XSL transformation. This is passed to the R function called from an XSL rule if that R function is of class XSLTContextFunction.

Value

xsltGetCurrentNode returns an object of class XMLInternalNode, with the appropriate specific type given by the first element of the class vector, e.g. XMLInternalElementNode, XMLInternalTextNode, ...

xsltGetCurrentTemplate returns an object of S3 class XSLTemplateDescription. This has the following fields:

stylesheet

a reference to the C-level/internal XSL style sheet object in which the template is defined.

match

the match attribute

name

the name attribute

mode

the mode attribute

node

the XML node representing this xsl:template element

priority

an integer indicating the computed priority of this template

Author(s)

Duncan Temple Lang

References

libxslt and libxml2

See Also

xsltApplyStyleSheet


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