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 #include
"domstubs.idl"
10 [scriptable
, uuid(4a91aeb3
-4100-43ee
-a21e
-9866268757c5
)]
11 interface nsIXSLTProcessor
: nsISupports
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
24 * @exception nsIXSLTException
26 void importStylesheet
(in nsIDOMNode style
);
29 * Transforms the node source applying the stylesheet given by
30 * the importStylesheet() function. The owner document of the output node
31 * owns the returned document fragment.
33 * @param source The node to be transformed
34 * @param output This document is used to generate the output
35 * @return DocumentFragment The result of the transformation
37 * @exception nsIXSLTException
39 nsIDOMDocumentFragment transformToFragment
(in nsIDOMNode
source,
40 in nsIDOMDocument output
);
43 * Transforms the node source applying the stylesheet given by the
44 * importStylesheet() function.
46 * @param source The node to be transformed
47 * @return Document The result of the transformation
49 * @exception nsIXSLTException
51 nsIDOMDocument transformToDocument
(in nsIDOMNode
source);
54 * Sets a parameter to be used in subsequent transformations with this
55 * nsIXSLTProcessor. If the parameter doesn't exist in the stylesheet the
56 * parameter will be ignored.
58 * @param namespaceURI The namespaceURI of the XSLT parameter
59 * @param localName The local name of the XSLT parameter
60 * @param value The new value of the XSLT parameter
62 * @exception NS_ERROR_ILLEGAL_VALUE The datatype of value is
65 void setParameter
(in DOMString namespaceURI
,
66 in DOMString localName
,
70 * Gets a parameter if previously set by setParameter. Returns null
73 * @param namespaceURI The namespaceURI of the XSLT parameter
74 * @param localName The local name of the XSLT parameter
75 * @return nsIVariant The value of the XSLT parameter
77 nsIVariant getParameter
(in DOMString namespaceURI
,
78 in DOMString localName
);
80 * Removes a parameter, if set. This will make the processor use the
81 * default-value for the parameter as specified in the stylesheet.
83 * @param namespaceURI The namespaceURI of the XSLT parameter
84 * @param localName The local name of the XSLT parameter
86 void removeParameter
(in DOMString namespaceURI
,
87 in DOMString localName
);
90 * Removes all set parameters from this nsIXSLTProcessor. This will make
91 * the processor use the default-value for all parameters as specified in
94 void clearParameters
();
97 * Remove all parameters and stylesheets from this nsIXSLTProcessor.