michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "domstubs.idl" michael@0: michael@0: interface nsIVariant; michael@0: michael@0: [scriptable, uuid(4a91aeb3-4100-43ee-a21e-9866268757c5)] michael@0: interface nsIXSLTProcessor : nsISupports michael@0: { michael@0: /** michael@0: * Import the stylesheet into this XSLTProcessor for transformations. michael@0: * michael@0: * @param style The root-node of a XSLT stylesheet. This can be either michael@0: * a document node or an element node. If a document node michael@0: * then the document can contain either a XSLT stylesheet michael@0: * or a LRE stylesheet. michael@0: * If the argument is an element node it must be the michael@0: * xsl:stylesheet (or xsl:transform) element of an XSLT michael@0: * stylesheet. michael@0: * michael@0: * @exception nsIXSLTException michael@0: */ michael@0: void importStylesheet(in nsIDOMNode style); michael@0: michael@0: /** michael@0: * Transforms the node source applying the stylesheet given by michael@0: * the importStylesheet() function. The owner document of the output node michael@0: * owns the returned document fragment. michael@0: * michael@0: * @param source The node to be transformed michael@0: * @param output This document is used to generate the output michael@0: * @return DocumentFragment The result of the transformation michael@0: * michael@0: * @exception nsIXSLTException michael@0: */ michael@0: nsIDOMDocumentFragment transformToFragment(in nsIDOMNode source, michael@0: in nsIDOMDocument output); michael@0: michael@0: /** michael@0: * Transforms the node source applying the stylesheet given by the michael@0: * importStylesheet() function. michael@0: * michael@0: * @param source The node to be transformed michael@0: * @return Document The result of the transformation michael@0: * michael@0: * @exception nsIXSLTException michael@0: */ michael@0: nsIDOMDocument transformToDocument(in nsIDOMNode source); michael@0: michael@0: /** michael@0: * Sets a parameter to be used in subsequent transformations with this michael@0: * nsIXSLTProcessor. If the parameter doesn't exist in the stylesheet the michael@0: * parameter will be ignored. michael@0: * michael@0: * @param namespaceURI The namespaceURI of the XSLT parameter michael@0: * @param localName The local name of the XSLT parameter michael@0: * @param value The new value of the XSLT parameter michael@0: * michael@0: * @exception NS_ERROR_ILLEGAL_VALUE The datatype of value is michael@0: * not supported michael@0: */ michael@0: void setParameter(in DOMString namespaceURI, michael@0: in DOMString localName, michael@0: in nsIVariant value); michael@0: michael@0: /** michael@0: * Gets a parameter if previously set by setParameter. Returns null michael@0: * otherwise. michael@0: * michael@0: * @param namespaceURI The namespaceURI of the XSLT parameter michael@0: * @param localName The local name of the XSLT parameter michael@0: * @return nsIVariant The value of the XSLT parameter michael@0: */ michael@0: nsIVariant getParameter(in DOMString namespaceURI, michael@0: in DOMString localName); michael@0: /** michael@0: * Removes a parameter, if set. This will make the processor use the michael@0: * default-value for the parameter as specified in the stylesheet. michael@0: * michael@0: * @param namespaceURI The namespaceURI of the XSLT parameter michael@0: * @param localName The local name of the XSLT parameter michael@0: */ michael@0: void removeParameter(in DOMString namespaceURI, michael@0: in DOMString localName); michael@0: michael@0: /** michael@0: * Removes all set parameters from this nsIXSLTProcessor. This will make michael@0: * the processor use the default-value for all parameters as specified in michael@0: * the stylesheet. michael@0: */ michael@0: void clearParameters(); michael@0: michael@0: /** michael@0: * Remove all parameters and stylesheets from this nsIXSLTProcessor. michael@0: */ michael@0: void reset(); michael@0: };