Module org.htmlunit

Class XSLTProcessor

java.lang.Object
org.htmlunit.corejs.javascript.SlotMapOwner<org.htmlunit.corejs.javascript.Scriptable>
org.htmlunit.corejs.javascript.ScriptableObject
org.htmlunit.javascript.HtmlUnitScriptable
org.htmlunit.javascript.host.xml.XSLTProcessor
All Implemented Interfaces:
Serializable, Cloneable, org.htmlunit.corejs.javascript.ConstProperties<org.htmlunit.corejs.javascript.Scriptable>, org.htmlunit.corejs.javascript.debug.DebuggableObject, org.htmlunit.corejs.javascript.PropHolder<org.htmlunit.corejs.javascript.Scriptable>, org.htmlunit.corejs.javascript.Scriptable, org.htmlunit.corejs.javascript.SymbolScriptable

public class XSLTProcessor extends HtmlUnitScriptable
JavaScript host object for XSLTProcessor.
Author:
Ahmed Ashour, Ronald Brill, MatrixNeoKozak (matrixneo2026@tutamail.com)
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.htmlunit.corejs.javascript.ScriptableObject

    org.htmlunit.corejs.javascript.ScriptableObject.DescriptorInfo, org.htmlunit.corejs.javascript.ScriptableObject.KeyComparator, org.htmlunit.corejs.javascript.ScriptableObject.LambdaGetterFunction, org.htmlunit.corejs.javascript.ScriptableObject.LambdaSetterFunction
  • Field Summary

    Fields inherited from class org.htmlunit.corejs.javascript.ScriptableObject

    CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST

    Fields inherited from class org.htmlunit.corejs.javascript.SlotMapOwner

    isSealed

    Fields inherited from interface org.htmlunit.corejs.javascript.Scriptable

    NOT_FOUND
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    getParameter(String namespaceURI, String localName)
    Returns a parameter previously set by setParameter(java.lang.String, java.lang.String, java.lang.Object), or null if not set.
    void
    Imports the specified stylesheet into this XSLTProcessor for transformations.
    void
    Creates an instance of this object.
    void
    setParameter(String namespaceURI, String localName, Object value)
    Sets a parameter to be used in subsequent transformations with this XSLTProcessor.
    Transforms the given source node by applying the stylesheet imported via importStylesheet(org.htmlunit.javascript.host.dom.Node).
    transformToFragment(Node source, Object output)
    Transforms the given source node by applying the imported stylesheet and appends the result as children of the given output document fragment.

    Methods inherited from class org.htmlunit.corejs.javascript.ScriptableObject

    applyDescriptorToAttributeBitset, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkNotSealed, checkPropertyChangeForSlot, checkPropertyChangeForSlot, checkPropertyDefinition, checkPropertyDefinition, checkSlotRemoval, defineBuiltinProperty, defineBuiltinProperty, defineBuiltInProperty, defineBuiltInProperty, defineBuiltInProperty, defineBuiltInProperty, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, delete, deleteProperty, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureScriptableObjectButNotSymbol, ensureSymbolScriptable, ensureType, get, get, getAllIds, getAncestor, getArrayPrototype, getClassPrototype, getClassPrototype, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getSuperProperty, getSuperProperty, getSuperProperty, getThis, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, hasProperty, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGenericDescriptor, isGetterOrSetter, isGetterOrSetter, isTrue, preventExtensions, put, put, putConst, putConstProperty, putConstProperty, putOwnProperty, putOwnProperty, putOwnProperty, putProperty, putProperty, putProperty, putProperty, putSuperProperty, putSuperProperty, putSuperProperty, querySlot, redefineProperty, redefineProperty, sameValue, sealObject, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setParentScope, setPrototype, size

    Methods inherited from class org.htmlunit.corejs.javascript.SlotMapOwner

    associateValue, checkNotSealed, copyAssociatedValue, createSlotMap, defineProperty, defineProperty, get, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getAttributes, getIds, has, has, isSealed, readMaps, setAttributes, setAttributes, setAttributes, setAttributes, setAttributes, writeMaps

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.htmlunit.corejs.javascript.Scriptable

    get, getIds, has, has

    Methods inherited from interface org.htmlunit.corejs.javascript.SymbolScriptable

    get, has
  • Constructor Details

    • XSLTProcessor

      public XSLTProcessor()
  • Method Details

    • jsConstructor

      public void jsConstructor()
      Creates an instance of this object.
    • importStylesheet

      public void 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 an XSLT stylesheet or an 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)
    • transformToDocument

      public XMLDocument transformToDocument(Node source)
      Transforms the given source node by applying the stylesheet imported via importStylesheet(org.htmlunit.javascript.host.dom.Node). The owner document of the output node owns the returned document.
      Parameters:
      source - the node to be transformed
      Returns:
      the transformation result as an XMLDocument
    • transformToFragment

      public DocumentFragment transformToFragment(Node source, Object output)
      Transforms the given source node by applying the imported stylesheet and appends the result as children of the given output document fragment.
      Parameters:
      source - the node to be transformed
      output - the Document whose owner document is used to generate the output
      Returns:
      the transformation result as a DocumentFragment
    • setParameter

      public void setParameter(String namespaceURI, String localName, Object value)
      Sets a parameter to be used in subsequent transformations with this XSLTProcessor. If the parameter does not exist in the stylesheet it will be ignored.
      Parameters:
      namespaceURI - the namespace URI of the XSLT parameter
      localName - the local name of the XSLT parameter
      value - the new value of the XSLT parameter
    • getParameter

      public Object getParameter(String namespaceURI, String localName)
      Returns a parameter previously set by setParameter(java.lang.String, java.lang.String, java.lang.Object), or null if not set.
      Parameters:
      namespaceURI - the namespace URI of the XSLT parameter
      localName - the local name of the XSLT parameter
      Returns:
      the value of the XSLT parameter, or null if not found