1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
9 interface XSLTProcessor {
13 * Import the stylesheet into this XSLTProcessor for transformations.
15 * @param style The root-node of a XSLT stylesheet. This can be either
16 * a document node or an element node. If a document node
17 * then the document can contain either a XSLT stylesheet
18 * or a LRE stylesheet.
19 * If the argument is an element node it must be the
20 * xsl:stylesheet (or xsl:transform) element of an XSLT
24 void importStylesheet(Node style);
27 * Transforms the node source applying the stylesheet given by
28 * the importStylesheet() function. The owner document of the output node
29 * owns the returned document fragment.
31 * @param source The node to be transformed
32 * @param output This document is used to generate the output
33 * @return DocumentFragment The result of the transformation
36 DocumentFragment transformToFragment(Node source,
40 * Transforms the node source applying the stylesheet given by the
41 * importStylesheet() function.
43 * @param source The node to be transformed
44 * @return Document The result of the transformation
47 Document transformToDocument(Node source);
50 * Sets a parameter to be used in subsequent transformations with this
51 * XSLTProcessor. If the parameter doesn't exist in the stylesheet the
52 * parameter will be ignored.
54 * @param namespaceURI The namespaceURI of the XSLT parameter
55 * @param localName The local name of the XSLT parameter
56 * @param value The new value of the XSLT parameter
59 void setParameter([TreatNullAs=EmptyString] DOMString namespaceURI,
64 * Gets a parameter if previously set by setParameter. Returns null
67 * @param namespaceURI The namespaceURI of the XSLT parameter
68 * @param localName The local name of the XSLT parameter
69 * @return nsIVariant The value of the XSLT parameter
72 nsIVariant? getParameter([TreatNullAs=EmptyString] DOMString namespaceURI,
75 * Removes a parameter, if set. This will make the processor use the
76 * default-value for the parameter as specified in the stylesheet.
78 * @param namespaceURI The namespaceURI of the XSLT parameter
79 * @param localName The local name of the XSLT parameter
82 void removeParameter([TreatNullAs=EmptyString] DOMString namespaceURI,
86 * Removes all set parameters from this XSLTProcessor. This will make
87 * the processor use the default-value for all parameters as specified in
90 void clearParameters();
93 * Remove all parameters and stylesheets from this XSLTProcessor.
98 * Disables all loading of external documents, such as from
99 * <xsl:import> and document()
100 * Defaults to off and is *not* reset by calls to reset()
103 const unsigned long DISABLE_ALL_LOADS = 1;
106 * Flags for this processor. Defaults to 0. See individual flags above
107 * for documentation for effect of reset()
109 [ChromeOnly, NeedsCallerType]
110 attribute unsigned long flags;