getXSLParams: Extract the top-level XSL parameters and default values in an...

getXSLParamsR Documentation

Extract the top-level XSL parameters and default values in an XSL stylesheet

Description

This function processes an XSL file and recursively its xsl:import and xsl:include elements and then extracts the top-level XSL parameters. It returns a vector of the values, using the names of the XSL parameters as the names of the R vector.

This function can help us learn about the possible XSL parameters we can use to control the run-time behavior of the stylesheet and also find the default values. This was originally motivated by the desire to find XSL parameters for transformation to FO to compare the coloring of code elements with that in CSS files for HTML.

Usage

getXSLParams(doc, recursive = TRUE)

Arguments

doc

the XSL document, either as file name or URL name (i.e. a character) or a parsed XSL document (via xmlParse and not xsltParseStyleSheet).

recursive

a logical value indicating whether to process the xsl:import and xsl:include elements and replace these with the actual stylesheet contents to which they refer.

Details

This uses readXSL to preform the recursive inclusion of the XSL documents.

Value

Either a character vector or a list if any of the default values for the XSL parameters are nodes rather than single values. The names of the elements are the names of the XSL parameter.s

Author(s)

Duncan Temple Lang

References

The XSL specification.

See Also

xsltApplyStyleSheet xsltParseStyleSheet

Examples

  system.file()

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