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

View source: R/context.R

xsltInsertR Documentation

Tools for adding nodes to the the target/output document in an XSL transformation.

Description

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.

Usage

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

Arguments

ctx

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.

.nodes

the collection of nodes to insert as a list.

Value

NULL

Author(s)

Duncan Temple Lang

See Also

xsltContextFunction xsltApplyStyleSheet


omegahat/Sxslt documentation built on Jan. 17, 2024, 6:44 p.m.