toc.XSL: Get a table of contents of templates in an XSL document (and...

toc.XSLR Documentation

Get a table of contents of templates in an XSL document (and imports)

Description

This is a utility function that retrieves the specification of the node names and expressions that templates match in an XSL templates. This is useful for understanding what node names are "active". This can help in documenting and understanding the entire set of nodes.

This function can recursively process sub-XSL documents which are import'ed or include'd via XSL.

Usage

toc.XSL(doc, base = if (is.character(doc)) doc else docName(doc), recursive = TRUE, ignore = character())

Arguments

doc

the XSL document, either a file name, URL or a parsed document

base

the base document, which defaults to doc.

recursive

a logical value indicating whether to process xsl:import or xsl:include.

ignore

a character vector. This can be a vector of URLs or file names to not process

Value

A character vector giving the individual parts of the different templates, e.g c("r:code", "r:expr") from the template <xsl:template match="r:code|r:expr"> All of the different templates are merged together.

Author(s)

Duncan Temple Lang

See Also

xmlParse getNodeSet

Examples

library(XML)
  xsl = catalogResolve("http://www.omegahat.org/XDynDocs/XSL/html.xsl")
 
  tmpls = toc.XSL(xsl, recursive = FALSE)

  tmpls = toc.XSL(xsl)

  tmpls = toc.XSL(xsl, ignore = "http://docbook")

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