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/. */
6 typedef (unrestricted double or boolean or DOMString or Node or sequence<Node> or XPathResult) XSLTParameterValue;
9 interface XSLTProcessor {
14 * Import the stylesheet into this XSLTProcessor for transformations.
16 * @param style The root-node of a XSLT stylesheet. This can be either
17 * a document node or an element node. If a document node
18 * then the document can contain either a XSLT stylesheet
19 * or a LRE stylesheet.
20 * If the argument is an element node it must be the
21 * xsl:stylesheet (or xsl:transform) element of an XSLT
25 undefined importStylesheet(Node style);
28 * Transforms the node source applying the stylesheet given by
29 * the importStylesheet() function. The owner document of the output node
30 * owns the returned document fragment.
32 * @param source The node to be transformed
33 * @param output This document is used to generate the output
34 * @return DocumentFragment The result of the transformation
37 DocumentFragment transformToFragment(Node source,
41 * Transforms the node source applying the stylesheet given by the
42 * importStylesheet() function.
44 * @param source The node to be transformed
45 * @return Document The result of the transformation
48 Document transformToDocument(Node source);
51 * Sets a parameter to be used in subsequent transformations with this
52 * XSLTProcessor. If the parameter doesn't exist in the stylesheet the
53 * parameter will be ignored.
55 * @param namespaceURI The namespaceURI of the XSLT parameter
56 * @param localName The local name of the XSLT parameter
57 * @param value The new value of the XSLT parameter
60 undefined setParameter([LegacyNullToEmptyString] DOMString namespaceURI,
62 XSLTParameterValue value);
65 * Gets a parameter if previously set by setParameter. Returns null
68 * @param namespaceURI The namespaceURI of the XSLT parameter
69 * @param localName The local name of the XSLT parameter
70 * @return ParameterValue The value of the XSLT parameter
73 XSLTParameterValue? getParameter([LegacyNullToEmptyString] DOMString namespaceURI,
76 * Removes a parameter, if set. This will make the processor use the
77 * default-value for the parameter as specified in the stylesheet.
79 * @param namespaceURI The namespaceURI of the XSLT parameter
80 * @param localName The local name of the XSLT parameter
83 undefined removeParameter([LegacyNullToEmptyString] DOMString namespaceURI,
87 * Removes all set parameters from this XSLTProcessor. This will make
88 * the processor use the default-value for all parameters as specified in
91 undefined clearParameters();
94 * Remove all parameters and stylesheets from this XSLTProcessor.
99 * Disables all loading of external documents, such as from
100 * <xsl:import> and document()
101 * Defaults to off and is *not* reset by calls to reset()
104 const unsigned long DISABLE_ALL_LOADS = 1;
107 * Flags for this processor. Defaults to 0. See individual flags above
108 * for documentation for effect of reset()
110 [ChromeOnly, NeedsCallerType]
111 attribute unsigned long flags;