xsltInsert: Tools for adding nodes to the the target/output document in...

Description Usage Arguments Value Author(s) See Also

View source: R/context.R


These functions allow us to directly insert new nodes or content into the document being created in an XSL transformation. xsltInsert inserts one or more (internal) nodes directly into the document as children of the currently active node.

xsltGetInsertNode allows us to retrieve a reference to the (internal) XML node that is the current point of insertion in the XSL transformation process. We can then use other tools (e.g. addChildren) to add content to that node or to navigate to a different node in the tree and add content there.


xsltInsert(ctx, ..., .nodes = list(...))



the XMLXPathParserContext object that is passed to an R function that is called from the XSL transformation. Such an R function must be registered with XSLT as an extension function, typically using addXSLTFunctions and must be an object of (S3) class XSLContextFunction created by a call to xsltContextFunction.


zero or more (internal/C-level) nodes which are to be inserted as children of the currently active node in the output document. Text is converted to XMLInternalTextNode objects. This mechanism of specifying the nodes individually is useful for interactive use. When the collection of nodes have been pre-computed and are in a list, use the .nodes argument.


the collection of nodes to insert as a list.




Duncan Temple Lang

See Also

xsltContextFunction xsltApplyStyleSheet

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