1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/xslt/nsIXSLTProcessor.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,100 @@ 1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#include "domstubs.idl" 1.10 + 1.11 +interface nsIVariant; 1.12 + 1.13 +[scriptable, uuid(4a91aeb3-4100-43ee-a21e-9866268757c5)] 1.14 +interface nsIXSLTProcessor : nsISupports 1.15 +{ 1.16 + /** 1.17 + * Import the stylesheet into this XSLTProcessor for transformations. 1.18 + * 1.19 + * @param style The root-node of a XSLT stylesheet. This can be either 1.20 + * a document node or an element node. If a document node 1.21 + * then the document can contain either a XSLT stylesheet 1.22 + * or a LRE stylesheet. 1.23 + * If the argument is an element node it must be the 1.24 + * xsl:stylesheet (or xsl:transform) element of an XSLT 1.25 + * stylesheet. 1.26 + * 1.27 + * @exception nsIXSLTException 1.28 + */ 1.29 + void importStylesheet(in nsIDOMNode style); 1.30 + 1.31 + /** 1.32 + * Transforms the node source applying the stylesheet given by 1.33 + * the importStylesheet() function. The owner document of the output node 1.34 + * owns the returned document fragment. 1.35 + * 1.36 + * @param source The node to be transformed 1.37 + * @param output This document is used to generate the output 1.38 + * @return DocumentFragment The result of the transformation 1.39 + * 1.40 + * @exception nsIXSLTException 1.41 + */ 1.42 + nsIDOMDocumentFragment transformToFragment(in nsIDOMNode source, 1.43 + in nsIDOMDocument output); 1.44 + 1.45 + /** 1.46 + * Transforms the node source applying the stylesheet given by the 1.47 + * importStylesheet() function. 1.48 + * 1.49 + * @param source The node to be transformed 1.50 + * @return Document The result of the transformation 1.51 + * 1.52 + * @exception nsIXSLTException 1.53 + */ 1.54 + nsIDOMDocument transformToDocument(in nsIDOMNode source); 1.55 + 1.56 + /** 1.57 + * Sets a parameter to be used in subsequent transformations with this 1.58 + * nsIXSLTProcessor. If the parameter doesn't exist in the stylesheet the 1.59 + * parameter will be ignored. 1.60 + * 1.61 + * @param namespaceURI The namespaceURI of the XSLT parameter 1.62 + * @param localName The local name of the XSLT parameter 1.63 + * @param value The new value of the XSLT parameter 1.64 + * 1.65 + * @exception NS_ERROR_ILLEGAL_VALUE The datatype of value is 1.66 + * not supported 1.67 + */ 1.68 + void setParameter(in DOMString namespaceURI, 1.69 + in DOMString localName, 1.70 + in nsIVariant value); 1.71 + 1.72 + /** 1.73 + * Gets a parameter if previously set by setParameter. Returns null 1.74 + * otherwise. 1.75 + * 1.76 + * @param namespaceURI The namespaceURI of the XSLT parameter 1.77 + * @param localName The local name of the XSLT parameter 1.78 + * @return nsIVariant The value of the XSLT parameter 1.79 + */ 1.80 + nsIVariant getParameter(in DOMString namespaceURI, 1.81 + in DOMString localName); 1.82 + /** 1.83 + * Removes a parameter, if set. This will make the processor use the 1.84 + * default-value for the parameter as specified in the stylesheet. 1.85 + * 1.86 + * @param namespaceURI The namespaceURI of the XSLT parameter 1.87 + * @param localName The local name of the XSLT parameter 1.88 + */ 1.89 + void removeParameter(in DOMString namespaceURI, 1.90 + in DOMString localName); 1.91 + 1.92 + /** 1.93 + * Removes all set parameters from this nsIXSLTProcessor. This will make 1.94 + * the processor use the default-value for all parameters as specified in 1.95 + * the stylesheet. 1.96 + */ 1.97 + void clearParameters(); 1.98 + 1.99 + /** 1.100 + * Remove all parameters and stylesheets from this nsIXSLTProcessor. 1.101 + */ 1.102 + void reset(); 1.103 +};