nsIXSLTProcessor

Methods

importStylesheet(style)

Import the stylesheet into this XSLTProcessor for transformations.

@exception nsIXSLTException

Parameters

style The root-node of a XSLT stylesheet. This can be either a document node or an element node. If a document node then the document can contain either a XSLT stylesheet or a LRE stylesheet. If the argument is an element node it must be the xsl:stylesheet (or xsl:transform) element of an XSLT stylesheet.

transformToFragment(source, output)

Transforms the node source applying the stylesheet given by
the importStylesheet() function. The owner document of the output node
owns the returned document fragment.

@exception nsIXSLTException

Parameters

source The node to be transformed
output This document is used to generate the output

Returns

DocumentFragment The result of the transformation

transformToDocument(source)

Transforms the node source applying the stylesheet given by the
importStylesheet() function.

@exception nsIXSLTException

Parameters

source The node to be transformed

Returns

Document The result of the transformation

setParameter(namespaceURI, localName, value)

Sets a parameter to be used in subsequent transformations with this
nsIXSLTProcessor. If the parameter doesn’t exist in the stylesheet the
parameter will be ignored.

@exception NS_ERROR_ILLEGAL_VALUE The datatype of value is
not supported

Parameters

namespaceURI The namespaceURI of the XSLT parameter
localName The local name of the XSLT parameter
value The new value of the XSLT parameter

getParameter(namespaceURI, localName)

Gets a parameter if previously set by setParameter. Returns null
otherwise.

Parameters

namespaceURI The namespaceURI of the XSLT parameter
localName The local name of the XSLT parameter

Returns

nsIVariant The value of the XSLT parameter

removeParameter(namespaceURI, localName)

Removes a parameter, if set. This will make the processor use the
default-value for the parameter as specified in the stylesheet.

Parameters

namespaceURI The namespaceURI of the XSLT parameter
localName The local name of the XSLT parameter

clearParameters()

Removes all set parameters from this nsIXSLTProcessor. This will make
the processor use the default-value for all parameters as specified in
the stylesheet.

reset()

Remove all parameters and stylesheets from this nsIXSLTProcessor.