com.gargoylesoftware.htmlunit.javascript.host
Class XSLTProcessor

java.lang.Object
  extended by net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
      extended by com.gargoylesoftware.htmlunit.javascript.SimpleScriptable
          extended by com.gargoylesoftware.htmlunit.javascript.host.XSLTProcessor
All Implemented Interfaces:
Serializable, Cloneable, Map, net.sourceforge.htmlunit.corejs.javascript.ConstProperties, net.sourceforge.htmlunit.corejs.javascript.debug.DebuggableObject, net.sourceforge.htmlunit.corejs.javascript.Scriptable

public class XSLTProcessor
extends SimpleScriptable

A JavaScript object for XSLTProcessor.

Version:
$Revision: 5864 $
Author:
Ahmed Ashour
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Field Summary
 
Fields inherited from class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
 
Fields inherited from interface net.sourceforge.htmlunit.corejs.javascript.Scriptable
NOT_FOUND
 
Constructor Summary
XSLTProcessor()
           
 
Method Summary
 void jsConstructor()
          JavaScript constructor.
 void jsxFunction_addParameter(String baseName, Object parameter, Object namespaceURI)
          Adds parameters into an XSL Transformations (XSLT) style sheet.
 Object jsxFunction_getParameter(String namespaceURI, String localName)
          Gets a parameter if previously set by setParameter.
 void jsxFunction_importStylesheet(Node style)
          Imports the specified stylesheet into this XSLTProcessor for transformations.
 void jsxFunction_setParameter(String namespaceURI, String localName, Object value)
          Sets a parameter to be used in subsequent transformations with this nsIXSLTProcessor.
 void jsxFunction_transform()
          Starts the transformation process or resumes a previously failed transformation.
 XMLDocument jsxFunction_transformToDocument(Node source)
          Transforms the node source applying the stylesheet given by the importStylesheet() function.
 DocumentFragment jsxFunction_transformToFragment(Node source, Object output)
          Transforms the node source applying the stylesheet given by the importStylesheet() function.
 Node jsxGet_input()
          Returns which XML input tree to transform.
 Object jsxGet_output()
          Gets a custom output to write the result of the transformation.
 void jsxSet_input(Node input)
          Specifies which XML input tree to transform.
 void jsxSet_output(Object output)
          Sets the object to which to write the output of the transformation.
 
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.SimpleScriptable
clone, defineFunctionProperties, defineProperty, equivalentValues, get, getBrowserVersion, getClassName, getDefaultValue, getDomNodeOrDie, getDomNodeOrNull, getPrototype, getScriptableFor, getStartingScope, getTransformerScriptableFor, getWindow, getWindow, getWithPreemption, hasInstance, initParentScope, makeScriptableFor, setCaseSensitive, setDomNode, setDomNode, setHtmlElement
 
Methods inherited from class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, clear, containsKey, containsValue, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineOwnProperties, defineOwnProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, entrySet, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getSlot, getTopLevelScope, getTopScopeValue, getTypeOf, has, has, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, keySet, preventExtensions, put, put, put, putAll, putConst, putConstProperty, putProperty, putProperty, redefineProperty, remove, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototype, size, values
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

XSLTProcessor

public XSLTProcessor()
Method Detail

jsConstructor

public void jsConstructor()
JavaScript constructor.


jsxFunction_importStylesheet

public void jsxFunction_importStylesheet(Node style)
Imports the specified stylesheet into this XSLTProcessor for transformations. The specified node may be either a document node or an element node. If it is a document node, then the document can contain either a XSLT stylesheet or a LRE stylesheet. If it is an element node, it must be the xsl:stylesheet (or xsl:transform) element of an XSLT stylesheet.

Parameters:
style - the root-node of an XSLT stylesheet (may be a document node or an element node)

jsxFunction_transformToDocument

public XMLDocument jsxFunction_transformToDocument(Node source)
Transforms the node source applying the stylesheet given by the importStylesheet() function. The owner document of the output node owns the returned document fragment.

Parameters:
source - the node to be transformed
Returns:
the result of the transformation

jsxFunction_transformToFragment

public DocumentFragment jsxFunction_transformToFragment(Node source,
                                                        Object output)
Transforms the node source applying the stylesheet given by the importStylesheet() function. The owner document of the output node owns the returned document fragment.

Parameters:
source - the node to be transformed
output - This document is used to generate the output
Returns:
the result of the transformation

jsxFunction_setParameter

public void jsxFunction_setParameter(String namespaceURI,
                                     String localName,
                                     Object value)
Sets a parameter to be used in subsequent transformations with this nsIXSLTProcessor. If the parameter doesn't exist in the stylesheet the parameter will be ignored.

Parameters:
namespaceURI - the namespaceURI of the XSLT parameter
localName - the local name of the XSLT parameter
value - the new value of the XSLT parameter

jsxFunction_getParameter

public Object jsxFunction_getParameter(String namespaceURI,
                                       String localName)
Gets a parameter if previously set by setParameter. Returns null otherwise.

Parameters:
namespaceURI - the namespaceURI of the XSLT parameter
localName - the local name of the XSLT parameter
Returns:
the value of the XSLT parameter

jsxSet_input

public void jsxSet_input(Node input)
Specifies which XML input tree to transform.

Parameters:
input - the input tree

jsxGet_input

public Node jsxGet_input()
Returns which XML input tree to transform.

Returns:
which XML input tree to transform

jsxSet_output

public void jsxSet_output(Object output)
Sets the object to which to write the output of the transformation.

Parameters:
output - the object to which to write the output of the transformation

jsxGet_output

public Object jsxGet_output()
Gets a custom output to write the result of the transformation.

Returns:
the output of the transformation

jsxFunction_addParameter

public void jsxFunction_addParameter(String baseName,
                                     Object parameter,
                                     Object namespaceURI)
Adds parameters into an XSL Transformations (XSLT) style sheet.

Parameters:
baseName - the name that will be used inside the style sheet to identify the parameter context
parameter - the parameter value To remove a parameter previously added to the processor, provide a value of Empty or Null instead.
namespaceURI - an optional namespace

jsxFunction_transform

public void jsxFunction_transform()
Starts the transformation process or resumes a previously failed transformation.



Copyright © 2002-2011 Gargoyle Software Inc.. All Rights Reserved.