Overview | Package | Class | Use | Tree | Deprecated | Index | Help
|  | BEA Systems, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## weblogic.apache.xalan.transformer
Class TransformerImpl

    java.lang.Object
      |
      +--javax.xml.transform.Transformer
            |
            +--weblogic.apache.xalan.transformer.TransformerImpl

public class TransformerImpl
extends javax.xml.transform.Transformer
implements java.lang.Runnable, weblogic.apache.xml.dtm.DTMWSFilter

This class implements the `Transformer` interface, and is the core representation of the transformation execution.

This class is based on an implementation from the Apache XML Project. In future releases the XML parser, XSLT processor, and associated classes will likely be updated to be based on a later version of the Apache implementations. Since Apache does not guarantee backwards compatibility between versions of their software, we cannot guarantee backwards compatibility of any of the classes contained in the weblogic.apache package or sub-packages.

Inner Class Summary
`static class` | `TransformerImpl.ThreadControler` Base thread controler for xalan.

Field Summary
`protected boolean` | `m_useSourceLocationProperty` This property specifies whether the transformation phase should keep track of line and column numbers for the input source document.
`static boolean` | `S_DEBUG` This is a compile-time flag to turn off calling of trace listeners.

Constructor Summary
`TransformerImpl(StylesheetRoot stylesheet)` Construct a TransformerImpl.

Method Summary
`boolean` | `applyTemplateToNode(ElemTemplateElement xslInstruction, ElemTemplate template, int child)` Given an element and mode, find the corresponding template and process the contents.
`void` | `clearParameters()` Reset the parameters to a null list.
`org.xml.sax.ContentHandler` | `createResultContentHandler(javax.xml.transform.Result outputTarget)` Create a result ContentHandler from a Result object, based on the current OutputProperties.
`org.xml.sax.ContentHandler` | `createResultContentHandler(javax.xml.transform.Result outputTarget, OutputProperties format)` Create a ContentHandler from a Result object and an OutputProperties.
`boolean` | `currentTemplateRuleIsNull()` Tell if the current template rule is null, i.e.
`void` | `executeChildTemplates(ElemTemplateElement elem, boolean shouldAddAttrs)` Execute each of the children of a template element.
`void` | `executeChildTemplates(ElemTemplateElement elem, org.xml.sax.ContentHandler handler)` Execute each of the children of a template element.
`void` | `executeChildTemplates(ElemTemplateElement elem, org.w3c.dom.Node context, QName mode, org.xml.sax.ContentHandler handler)` Execute each of the children of a template element.
`void` | `executeFromSnapshot(TransformSnapshot ts)` This will execute the following XSLT instructions from the snapshot point, after the stylesheet execution context has been reset from the snapshot point.
`java.lang.String` | `getBaseURLOfSource()` Get the base URL of the source.
`org.xml.sax.ContentHandler` | `getContentHandler()` Get the content event handler.
`weblogic.apache.xml.dtm.DTMIterator` | `getContextNodeList()` Get the current context node list.
`CountersTable` | `getCountersTable()` Get the table of counters, for optimized xsl:number support.
`ElemTemplateElement` | `getCurrentElement()` Retrieves the current ElemTemplateElement that is being executed.
`int` | `getCurrentNode()` This method retrieves the current context node in the source tree.
`ElemTemplate` | `getCurrentTemplate()` This method retrieves the xsl:template that is in effect, which may be a matched template or a named template.
`javax.xml.transform.ErrorListener` | `getErrorListener()` Get the current error event handler.
`java.lang.Exception` | `getExceptionThrown()` Get the exception thrown by the secondary thread (normally the transform thread).
`boolean` | `getFeature(java.lang.String name)` Look up the value of a feature.
`org.xml.sax.ContentHandler` | `getInputContentHandler()` Get a SAX2 ContentHandler for the input.
`org.xml.sax.ContentHandler` | `getInputContentHandler(boolean doDocFrag)` Get a SAX2 ContentHandler for the input.
`org.xml.sax.ext.DeclHandler` | `getInputDeclHandler()` Get a SAX2 DeclHandler for the input.
`org.xml.sax.ext.LexicalHandler` | `getInputLexicalHandler()` Get a SAX2 LexicalHandler for the input.
`KeyManager` | `getKeyManager()` Get the KeyManager object.
`int` | `getMatchedNode()` Retrieves the node in the source tree that matched the template obtained via getMatchedTemplate().
`ElemTemplate` | `getMatchedTemplate()` This method retrieves the xsl:template that was matched.
`QName` | `getMode()` NEEDSDOC Method getMode NEEDSDOC (getMode) @return
`MsgMgr` | `getMsgMgr()` Return the message manager.
`OutputProperties` | `getOutputFormat()` Get the output properties used for the transformation.
`java.util.Properties` | `getOutputProperties()` Get a copy of the output properties for the transformation.
`java.lang.String` | `getOutputProperty(java.lang.String qnameString)` Get an output property that is in effect for the transformation.
`java.lang.String` | `getOutputPropertyNoDefault(java.lang.String qnameString)` Get the value of a property, without using the default properties.
`javax.xml.transform.Result` | `getOutputTarget()` Get the original output target.
`java.lang.Object` | `getParameter(java.lang.String name)` Get a parameter that was explicitly set with setParameter or setParameters.
`boolean` | `getProperty(java.lang.String property)` `getProperty` returns the current setting of the property described by the `property` argument.
`boolean` | `getQuietConflictWarnings()` Get quietConflictWarnings property.
`int` | `getRecursionLimit()` Get the recursion limit.
`ResultTreeHandler` | `getResultTreeHandler()` Get the ResultTreeHandler object.
`Serializer` | `getSerializer()` Get the current serializer in use, which may well not be the main serializer (for instance, this may well be a text serializer for string creation from templates).
`short` | `getShouldStripSpace(int elementHandle, weblogic.apache.xml.dtm.DTM dtm)` Test whether whitespace-only text nodes are visible in the logical view of `DTM`.
`TransformSnapshot` | `getSnapshot()` This will get a snapshot of the current executing context
`StackGuard` | `getStackGuard()` Get the object used to guard the stack from recursion.
`ObjectPool` | `getStringWriterPool()` Get the StringWriter pool, so that StringWriter objects may be reused.
`StylesheetRoot` | `getStylesheet()` Get the current stylesheet for this processor.
`TraceManager` | `getTraceManager()` Get an instance of the trace manager for this transformation.
`javax.xml.transform.Transformer` | `getTransformer()` Get the TrAX Transformer object in effect.
`java.lang.Thread` | `getTransformThread()` Get the thread that the transform process is on.
`javax.xml.transform.URIResolver` | `getURIResolver()` Get an object that will be used to resolve URIs used in document(), etc.
`XPathContext` | `getXPathContext()` Get the XPath context associated with this transformer.
`boolean` | `hasTransformThreadErrorCatcher()` Return true if the transform was initiated from the transform method, otherwise it was probably done from a pure parse events.
`boolean` | `isParserEventsOnMain()` Get true if the parser events should be on the main thread, false if not.
`boolean` | `isRecursiveAttrSet(ElemAttributeSet attrSet)` Check to see if this is a recursive attribute definition.
`boolean` | `isTransformDone()` Tell if the transform method is completed.
`void` | `popCurrentMatched()` Pop the elements that were pushed via pushPairCurrentMatched.
`void` | `popCurrentTemplateRuleIsNull()` Push true if the current template rule is null, false otherwise.
`void` | `popElemAttributeSet()` Pop the current executing attribute set.
`void` | `popElemTemplateElement()` Pop the current template element.
`void` | `popMode()` NEEDSDOC Method popMode
`java.util.Vector` | `processSortKeys(ElemForEach foreach, int sourceNodeContext)` Get the keys for the xsl:sort elements.
`void` | `pushCurrentTemplateRuleIsNull(boolean b)` Push true if the current template rule is null, false otherwise.
`void` | `pushElemAttributeSet(ElemAttributeSet attrSet)` Push an executing attribute set, so we can check for recursive attribute definitions.
`void` | `pushElemTemplateElement(ElemTemplateElement elem)` Push the current template element.
`protected void` | `pushGlobalVars(int contextNode)` Internal -- push the global variables from the Stylesheet onto the context's runtime variable stack.
`void` | `pushMode(QName mode)` NEEDSDOC Method pushMode NEEDSDOC @param mode
`void` | `pushPairCurrentMatched(ElemTemplateElement template, int child)` Push both the current xsl:template or xsl:for-each onto the stack, along with the child node that was matched.
`void` | `reset()` Reset the state.
`void` | `resetToStylesheet(TransformSnapshot ts)` This will reset the stylesheet execution context from the snapshot point.
`void` | `run()` Run the transform thread.
`void` | `runTransformThread()` Called by this.transform() if isParserEventsOnMain()==false.
`void` | `runTransformThread(int priority)` Called by SourceTreeHandler to start the transformation in a separate thread NEEDSDOC @param priority
`static void` | `runTransformThread(java.lang.Runnable runnable)` Called by CoRoutineSAXParser.
`void` | `setBaseURLOfSource(java.lang.String base)` Get the base URL of the source.
`void` | `setContentHandler(org.xml.sax.ContentHandler handler)` Set the content event handler.
`void` | `setCurrentElement(ElemTemplateElement e)` Set the top of the current template elements stack.
`void` | `setErrorListener(javax.xml.transform.ErrorListener listener)` Set the error event listener.
`void` | `setExceptionThrown(java.lang.Exception e)` Set the exception thrown by the secondary thread (normally the transform thread).
`void` | `setIsTransformDone(boolean done)` Set if the transform method is completed.
`void` | `setOutputFormat(OutputProperties oformat)` Set the output properties for the transformation.
`void` | `setOutputProperties(java.util.Properties oformat)` Set the output properties for the transformation.
`void` | `setOutputProperty(java.lang.String name, java.lang.String value)` Set the value of a property.
`void` | `setOutputTarget(javax.xml.transform.Result outputTarget)` Set the original output target.
`void` | `setParameter(java.lang.String name, java.lang.Object value)` Set a parameter for the transformation.
`void` | `setParameter(java.lang.String name, java.lang.String namespace, java.lang.Object value)` Set a parameter for the templates.
`void` | `setParameters(java.util.Properties params)` Set a bag of parameters for the transformation.
`void` | `setProperty(java.lang.String property, java.lang.Object value)` Set a runtime property for this `TransformerImpl`.
`void` | `setQuietConflictWarnings(boolean b)` If the quietConflictWarnings property is set to true, warnings about pattern conflicts won't be printed to the diagnostics stream.
`void` | `setRecursionLimit(int limit)` Set the recursion limit.
`void` | `setSerializer(Serializer s)` Set the current serializer.
`void` | `setShouldReset(boolean shouldReset)` NEEDSDOC Method setShouldReset NEEDSDOC @param shouldReset
`void` | `setSourceTreeDocForThread(int doc)` This is just a way to set the document for run().
`void` | `setStylesheet(StylesheetRoot stylesheetRoot)` Set the stylesheet for this processor.
`static void` | `setThreadControler(TransformerImpl.ThreadControler tp)` Change the ThreadControler that will be used to manage the transform threads.
`void` | `setTransformThread(java.lang.Thread t)` Get the thread that the transform process is on.
`void` | `setURIResolver(javax.xml.transform.URIResolver resolver)` Set an object that will be used to resolve URIs used in document(), etc.
`void` | `setXMLSource(javax.xml.transform.Source source)` Set the input source for the source tree, which is needed if the parse thread is not the main thread, in order for the parse thread's run method to get to the input source.
`void` | `setXPathContext(XPathContext xcontext)` Set the execution context for XPath.
`void` | `stopTransformation()` NEEDSDOC Method stopTransformation
`void` | `transform(javax.xml.transform.Source source)` Process the source tree to SAX parse events.
`void` | `transform(javax.xml.transform.Source source, boolean shouldRelease)` Process the source tree to SAX parse events.
`void` | `transform(javax.xml.transform.Source xmlSource, javax.xml.transform.Result outputTarget)` Process the source tree to the output result.
`void` | `transform(javax.xml.transform.Source xmlSource, javax.xml.transform.Result outputTarget, boolean shouldRelease)` Process the source tree to the output result.
`void` | `transformNode(int node)` Process the source node to the output result, if the processor supports the "http://xml.org/trax/features/dom/input" feature.
`void` | `transformNode(int node, javax.xml.transform.Result outputTarget)` Process the source node to the output result, if the processor supports the "http://xml.org/trax/features/dom/input" feature.
`int` | `transformToRTF(ElemTemplateElement templateParent)` Given a stylesheet element, create a result tree fragment from it's contents.
`java.lang.String` | `transformToString(ElemTemplateElement elem)` Take the contents of a template element, process it, and convert it to a string.
`void` | `waitTransformThread()` Used by SourceTreeHandler to wait until the transform completes

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### S_DEBUG

    public static boolean S_DEBUG

  This is a compile-time flag to turn off calling of trace listeners. Set this to false for optimization purposes.

### m_useSourceLocationProperty

    protected boolean m_useSourceLocationProperty

  This property specifies whether the transformation phase should keep track of line and column numbers for the input source document. By default is false.

Constructor Detail

### TransformerImpl

    public TransformerImpl(StylesheetRoot stylesheet)

  Construct a TransformerImpl.

  Parameters:
    `stylesheet` - The root of the stylesheet tree.

Method Detail

### setShouldReset

    public void setShouldReset(boolean shouldReset)

  NEEDSDOC Method setShouldReset NEEDSDOC @param shouldReset

### reset

    public void reset()

  Reset the state. This needs to be called after a process() call is invoked, if the processor is to be used again.

### getProperty

    public boolean getProperty(java.lang.String property)

  `getProperty` returns the current setting of the property described by the `property` argument.

  Parameters:
    `property` - a `String` value
  Returns:
    a `boolean` value

### setProperty

    public void setProperty(java.lang.String property,
                            java.lang.Object value)

  Set a runtime property for this `TransformerImpl`.

  Parameters:
    `property` - a `String` value
    `value` - an `Object` value

### isParserEventsOnMain

    public boolean isParserEventsOnMain()

  Get true if the parser events should be on the main thread, false if not. Experimental. Can not be set right now.

  Returns:
    true if the parser events should be on the main thread, false if not.

### getTransformThread

    public java.lang.Thread getTransformThread()

  Get the thread that the transform process is on.

  Returns:
    The thread that the transform process is on, or null.

### setTransformThread

    public void setTransformThread(java.lang.Thread t)

  Get the thread that the transform process is on.

  Parameters:
    `t` - The transform thread, may be null.

### hasTransformThreadErrorCatcher

    public boolean hasTransformThreadErrorCatcher()

  Return true if the transform was initiated from the transform method, otherwise it was probably done from a pure parse events. NEEDSDOC ($objectName$) @return

### transform

    public void transform(javax.xml.transform.Source source)
                   throws javax.xml.transform.TransformerException

  Process the source tree to SAX parse events.

  Parameters:
    `source` - The input for the source tree.
  Throws:
    javax.xml.transform.TransformerException -

### transform

    public void transform(javax.xml.transform.Source source,
                          boolean shouldRelease)
                   throws javax.xml.transform.TransformerException

  Process the source tree to SAX parse events.

  Parameters:
    `source` - The input for the source tree.
    `shouldRelease` - Flag indicating whether to release DTMManager.
  Throws:
    javax.xml.transform.TransformerException -

### getBaseURLOfSource

    public java.lang.String getBaseURLOfSource()

  Get the base URL of the source.

  Returns:
    The base URL of the source tree, or null.

### setBaseURLOfSource

    public void setBaseURLOfSource(java.lang.String base)

  Get the base URL of the source. NEEDSDOC @param base

  Returns:
    The base URL of the source tree, or null.

### getOutputTarget

    public javax.xml.transform.Result getOutputTarget()

  Get the original output target.

  Returns:
    The Result object used to kick of the transform or null.

### setOutputTarget

    public void setOutputTarget(javax.xml.transform.Result outputTarget)

  Set the original output target. This is useful when using a SAX transform and supplying a ContentHandler or when the URI of the output target should not be the same as the systemID of the original output target. NEEDSDOC @param outputTarget

### getOutputProperty

    public java.lang.String getOutputProperty(java.lang.String qnameString)
                                       throws java.lang.IllegalArgumentException

  Get an output property that is in effect for the transformation. The property specified may be a property that was set with setOutputProperty, or it may be a property specified in the stylesheet.

  Parameters:
    `name` - A non-null String that specifies an output property name, which may be namespace qualified. NEEDSDOC @param qnameString
  Returns:
    The string value of the output property, or null if no property was found.
  Throws:
    java.lang.IllegalArgumentException - If the property is not supported.
  Overrides:
    getOutputProperty in class javax.xml.transform.Transformer
  See Also:
    `OutputKeys`

### getOutputPropertyNoDefault

    public java.lang.String getOutputPropertyNoDefault(java.lang.String qnameString)
                                                throws java.lang.IllegalArgumentException

  Get the value of a property, without using the default properties. This can be used to test if a property has been explicitly set by the stylesheet or user.

  Parameters:
    `name` - The property name, which is a fully-qualified URI. NEEDSDOC @param qnameString
  Returns:
    The value of the property, or null if not found.
  Throws:
    java.lang.IllegalArgumentException - If the property is not supported, and is not namespaced.

### setOutputProperty

    public void setOutputProperty(java.lang.String name,
                                  java.lang.String value)
                           throws java.lang.IllegalArgumentException

  Set the value of a property. Recognized properties are:

  "http://xml.apache.org/xslt/sourcebase" - the base URL for the source, which is needed when pure SAX ContentHandler transformation is to be done.

  Parameters:
    `name` - The property name, which is a fully-qualified URI.
    `value` - The requested value for the property.
  Throws:
    java.lang.IllegalArgumentException - if the property name is not legal.
  Overrides:
    setOutputProperty in class javax.xml.transform.Transformer

### setOutputProperties

    public void setOutputProperties(java.util.Properties oformat)

  Set the output properties for the transformation. These properties will override properties set in the templates with xsl:output.

  If argument to this function is null, any properties previously set will be removed.

  Parameters:
    `oformat` - A set of output properties that will be used to override any of the same properties in effect for the transformation.
  Overrides:
    setOutputProperties in class javax.xml.transform.Transformer

### getOutputProperties

    public java.util.Properties getOutputProperties()

  Get a copy of the output properties for the transformation. These properties will override properties set in the templates with xsl:output.

  Note that mutation of the Properties object returned will not effect the properties that the transformation contains.

  Overrides:
    getOutputProperties in class javax.xml.transform.Transformer

### createResultContentHandler

    public org.xml.sax.ContentHandler createResultContentHandler(javax.xml.transform.Result outputTarget)
                                                          throws javax.xml.transform.TransformerException

  Create a result ContentHandler from a Result object, based on the current OutputProperties.

  Parameters:
    `outputTarget` - Where the transform result should go, should not be null.
  Returns:
    A valid ContentHandler that will create the result tree when it is fed SAX events.
  Throws:
    javax.xml.transform.TransformerException -

### createResultContentHandler

    public org.xml.sax.ContentHandler createResultContentHandler(javax.xml.transform.Result outputTarget,
                                                                 OutputProperties format)
                                                          throws javax.xml.transform.TransformerException

  Create a ContentHandler from a Result object and an OutputProperties.

  Parameters:
    `outputTarget` - Where the transform result should go, should not be null.
    `format` - The OutputProperties object that will contain instructions on how to serialize the output.
  Returns:
    A valid ContentHandler that will create the result tree when it is fed SAX events.
  Throws:
    javax.xml.transform.TransformerException -

### transform

    public void transform(javax.xml.transform.Source xmlSource,
                          javax.xml.transform.Result outputTarget)
                   throws javax.xml.transform.TransformerException

  Process the source tree to the output result.

  Parameters:
    `xmlSource` - The input for the source tree.
    `outputTarget` - The output source target.
  Throws:
    javax.xml.transform.TransformerException -
  Overrides:
    transform in class javax.xml.transform.Transformer

### transform

    public void transform(javax.xml.transform.Source xmlSource,
                          javax.xml.transform.Result outputTarget,
                          boolean shouldRelease)
                   throws javax.xml.transform.TransformerException

  Process the source tree to the output result.

  Parameters:
    `xmlSource` - The input for the source tree.
    `outputTarget` - The output source target.
    `shouldRelease` - Flag indicating whether to release DTMManager.
  Throws:
    javax.xml.transform.TransformerException -

### transformNode

    public void transformNode(int node,
                              javax.xml.transform.Result outputTarget)
                       throws javax.xml.transform.TransformerException

  Process the source node to the output result, if the processor supports the "http://xml.org/trax/features/dom/input" feature. %REVIEW% Do we need a Node version of this?

  Parameters:
    `node` - The input source node, which can be any valid DTM node.
    `outputTarget` - The output source target.
  Throws:
    javax.xml.transform.TransformerException -

### transformNode

    public void transformNode(int node)
                       throws javax.xml.transform.TransformerException

  Process the source node to the output result, if the processor supports the "http://xml.org/trax/features/dom/input" feature. %REVIEW% Do we need a Node version of this?

  Parameters:
    `node` - The input source node, which can be any valid DTM node.
    `outputTarget` - The output source target.
  Throws:
    javax.xml.transform.TransformerException -

### getInputContentHandler

    public org.xml.sax.ContentHandler getInputContentHandler()

  Get a SAX2 ContentHandler for the input.

  Returns:
    A valid ContentHandler, which should never be null, as long as getFeature("http://xml.org/trax/features/sax/input") returns true.

### getInputContentHandler

    public org.xml.sax.ContentHandler getInputContentHandler(boolean doDocFrag)

  Get a SAX2 ContentHandler for the input.

  Parameters:
    `doDocFrag` - true if a DocumentFragment should be created as the root, rather than a Document.
  Returns:
    A valid ContentHandler, which should never be null, as long as getFeature("http://xml.org/trax/features/sax/input") returns true.

### getInputDeclHandler

    public org.xml.sax.ext.DeclHandler getInputDeclHandler()

  Get a SAX2 DeclHandler for the input.

  Returns:
    A valid DeclHandler, which should never be null, as long as getFeature("http://xml.org/trax/features/sax/input") returns true.

### getInputLexicalHandler

    public org.xml.sax.ext.LexicalHandler getInputLexicalHandler()

  Get a SAX2 LexicalHandler for the input.

  Returns:
    A valid LexicalHandler, which should never be null, as long as getFeature("http://xml.org/trax/features/sax/input") returns true.

### setOutputFormat

    public void setOutputFormat(OutputProperties oformat)

  Set the output properties for the transformation. These properties will override properties set in the templates with xsl:output.

  Parameters:
    `oformat` - A valid OutputProperties object (which will not be mutated), or null.

### getOutputFormat

    public OutputProperties getOutputFormat()

  Get the output properties used for the transformation.

  Returns:
    the output format that was set by the user, otherwise the output format from the stylesheet.

### getSerializer

    public Serializer getSerializer()

  Get the current serializer in use, which may well not be the main serializer (for instance, this may well be a text serializer for string creation from templates).

  Returns:
    The current serializer, or null if there is none.

### setSerializer

    public void setSerializer(Serializer s)

  Set the current serializer.

  Parameters:
    `s` - The current serializer, or null.

### setParameter

    public void setParameter(java.lang.String name,
                             java.lang.String namespace,
                             java.lang.Object value)

  Set a parameter for the templates.

  Parameters:
    `name` - The name of the parameter.
    `namespace` - The namespace of the parameter.
    `value` - The value object. This can be any valid Java object -- it's up to the processor to provide the proper coersion to the object, or simply pass it on for use in extensions.

### setParameter

    public void setParameter(java.lang.String name,
                             java.lang.Object value)

  Set a parameter for the transformation.

  Parameters:
    `name` - The name of the parameter, which may have a namespace URI.
    `value` - The value object. This can be any valid Java object -- it's up to the processor to provide the proper coersion to the object, or simply pass it on for use in extensions.
  Overrides:
    setParameter in class javax.xml.transform.Transformer

### getParameter

    public java.lang.Object getParameter(java.lang.String name)

  Get a parameter that was explicitly set with setParameter or setParameters. NEEDSDOC @param name

  Returns:
    A parameter that has been set with setParameter or setParameters, *not* all the xsl:params on the stylesheet (which require a transformation Source to be evaluated).
  Overrides:
    getParameter in class javax.xml.transform.Transformer

### setParameters

    public void setParameters(java.util.Properties params)

  Set a bag of parameters for the transformation. Note that these will not be additive, they will replace the existing set of parameters.

  Parameters:
    `name` - The name of the parameter, which may have a namespace URI.
    `value` - The value object. This can be any valid Java object -- it's up to the processor to provide the proper coersion to the object, or simply pass it on for use in extensions. NEEDSDOC @param params

### clearParameters

    public void clearParameters()

  Reset the parameters to a null list.

  Overrides:
    clearParameters in class javax.xml.transform.Transformer

### pushGlobalVars

    protected void pushGlobalVars(int contextNode)
                           throws javax.xml.transform.TransformerException

  Internal -- push the global variables from the Stylesheet onto the context's runtime variable stack.

  If we encounter a variable that is already defined in the variable stack, we ignore it. This is because the second variable definition will be at a lower import precedence. Presumably, global variables at the same import precedence with the same name will have been caught during the recompose process.

  However, if we encounter a parameter that is already defined in the variable stack, we need to see if this is a parameter whose value was supplied by a setParameter call. If so, we need to "receive" the one already in the stack, ignoring this one. If it is just an earlier xsl:param or xsl:variable definition, we ignore it using the same reasoning as explained above for the variable.

  Parameters:
    `contextNode` - The root of the source tree, can't be null.
  Throws:
    javax.xml.transform.TransformerException -

### setURIResolver

    public void setURIResolver(javax.xml.transform.URIResolver resolver)

  Set an object that will be used to resolve URIs used in document(), etc.

  Parameters:
    `resolver` - An object that implements the URIResolver interface, or null.
  Overrides:
    setURIResolver in class javax.xml.transform.Transformer

### getURIResolver

    public javax.xml.transform.URIResolver getURIResolver()

  Get an object that will be used to resolve URIs used in document(), etc.

  Returns:
    An object that implements the URIResolver interface, or null.
  Overrides:
    getURIResolver in class javax.xml.transform.Transformer

### setContentHandler

    public void setContentHandler(org.xml.sax.ContentHandler handler)

  Set the content event handler.

  Parameters:
    `resolver` - The new content handler. NEEDSDOC @param handler
  Throws:
    java.lang.NullPointerException - If the handler is null.
  See Also:
    `XMLReader.setContentHandler(org.xml.sax.ContentHandler)`

### getContentHandler

    public org.xml.sax.ContentHandler getContentHandler()

  Get the content event handler.

  Returns:
    The current content handler, or null if none was set.
  See Also:
    `XMLReader.getContentHandler()`

### transformToRTF

    public int transformToRTF(ElemTemplateElement templateParent)
                       throws javax.xml.transform.TransformerException

  Given a stylesheet element, create a result tree fragment from it's contents.

  Parameters:
    `templateParent` - The template element that holds the fragment.
    `sourceNode` - The current source context node.
    `mode` - The mode under which the template is operating.
  Returns:
    An object that represents the result tree fragment.
  Throws:
    javax.xml.transform.TransformerException -

### getStringWriterPool

    public ObjectPool getStringWriterPool()

  Get the StringWriter pool, so that StringWriter objects may be reused.

  Returns:
    The string writer pool, not null.

### transformToString

    public java.lang.String transformToString(ElemTemplateElement elem)
                                       throws javax.xml.transform.TransformerException

  Take the contents of a template element, process it, and convert it to a string.

  Parameters:
    `elem` - The parent element whose children will be output as a string.
    `transformer` - The XSLT transformer instance.
    `sourceNode` - The current source node context.
    `mode` - The current xslt mode.
  Returns:
    The stringized result of executing the elements children.
  Throws:
    javax.xml.transform.TransformerException -

### applyTemplateToNode

    public boolean applyTemplateToNode(ElemTemplateElement xslInstruction,
                                       ElemTemplate template,
                                       int child)
                                throws javax.xml.transform.TransformerException

  Given an element and mode, find the corresponding template and process the contents.

  Parameters:
    `xslInstruction` - The calling element.
    `template` - The template to use if xsl:for-each, or null.
    `child` - The source context node.
    `mode` - The current mode, may be null.
  Returns:
    true if applied a template, false if not.
  Throws:
    javax.xml.transform.TransformerException -

### executeChildTemplates

    public void executeChildTemplates(ElemTemplateElement elem,
                                      org.w3c.dom.Node context,
                                      QName mode,
                                      org.xml.sax.ContentHandler handler)
                               throws javax.xml.transform.TransformerException

  Execute each of the children of a template element. This method is only for extension use.

  Parameters:
    `elem` - The ElemTemplateElement that contains the children that should execute.
    `sourceNode` - The current context node. NEEDSDOC @param context
    `mode` - The current mode.
    `handler` - The ContentHandler to where the result events should be fed.
  Throws:
    javax.xml.transform.TransformerException -

### executeChildTemplates

    public void executeChildTemplates(ElemTemplateElement elem,
                                      org.xml.sax.ContentHandler handler)
                               throws javax.xml.transform.TransformerException

  Execute each of the children of a template element.

  Parameters:
    `elem` - The ElemTemplateElement that contains the children that should execute.
    `handler` - The ContentHandler to where the result events should be fed.
  Throws:
    javax.xml.transform.TransformerException -

### executeChildTemplates

    public void executeChildTemplates(ElemTemplateElement elem,
                                      boolean shouldAddAttrs)
                               throws javax.xml.transform.TransformerException

  Execute each of the children of a template element.

  Parameters:
    `transformer` - The XSLT transformer instance.
    `elem` - The ElemTemplateElement that contains the children that should execute.
    `sourceNode` - The current context node.
    `mode` - The current mode.
    `shouldAddAttrs` - true if xsl:attributes should be executed.
  Throws:
    javax.xml.transform.TransformerException -

### processSortKeys

    public java.util.Vector processSortKeys(ElemForEach foreach,
                                            int sourceNodeContext)
                                     throws javax.xml.transform.TransformerException

  Get the keys for the xsl:sort elements. Note: Should this go into ElemForEach?

  Parameters:
    `foreach` - Valid ElemForEach element, not null.
    `sourceNodeContext` - The current node context in the source tree, needed to evaluate the Attribute Value Templates.
  Returns:
    A Vector of NodeSortKeys, or null.
  Throws:
    javax.xml.transform.TransformerException -

### pushElemTemplateElement

    public void pushElemTemplateElement(ElemTemplateElement elem)

  Push the current template element.

  Parameters:
    `elem` - The current ElemTemplateElement (may be null, and then set via setCurrentElement).

### popElemTemplateElement

    public void popElemTemplateElement()

  Pop the current template element.

### setCurrentElement

    public void setCurrentElement(ElemTemplateElement e)

  Set the top of the current template elements stack.

  Parameters:
    `e` - The current ElemTemplateElement about to be executed.

### getCurrentElement

    public ElemTemplateElement getCurrentElement()

  Retrieves the current ElemTemplateElement that is being executed.

  Returns:
    The current ElemTemplateElement that is executing, should not normally be null.

### getCurrentNode

    public int getCurrentNode()

  This method retrieves the current context node in the source tree.

  Returns:
    The current context node (should never be null?).

### getCurrentTemplate

    public ElemTemplate getCurrentTemplate()

  This method retrieves the xsl:template that is in effect, which may be a matched template or a named template.

  Please note that the ElemTemplate returned may be a default template, and thus may not have a template defined in the stylesheet.

  Returns:
    The current xsl:template, should not be null.

### pushPairCurrentMatched

    public void pushPairCurrentMatched(ElemTemplateElement template,
                                       int child)

  Push both the current xsl:template or xsl:for-each onto the stack, along with the child node that was matched. (Note: should this only be used for xsl:templates?? -sb)

  Parameters:
    `template` - xsl:template or xsl:for-each.
    `child` - The child that was matched.

### popCurrentMatched

    public void popCurrentMatched()

  Pop the elements that were pushed via pushPairCurrentMatched.

### getMatchedTemplate

    public ElemTemplate getMatchedTemplate()

  This method retrieves the xsl:template that was matched. Note that this may not be the same thing as the current template (which may be from getCurrentElement()), since a named template may be in effect.

  Returns:
    The pushed template that was pushed via pushPairCurrentMatched.

### getMatchedNode

    public int getMatchedNode()

  Retrieves the node in the source tree that matched the template obtained via getMatchedTemplate().

  Returns:
    The matched node that corresponds to the match attribute of the current xsl:template.

### getContextNodeList

    public weblogic.apache.xml.dtm.DTMIterator getContextNodeList()

  Get the current context node list.

  Returns:
    A reset clone of the context node list.

### getTransformer

    public javax.xml.transform.Transformer getTransformer()

  Get the TrAX Transformer object in effect.

  Returns:
    This object.

### setStylesheet

    public void setStylesheet(StylesheetRoot stylesheetRoot)

  Set the stylesheet for this processor. If this is set, then the process calls that take only the input .xml will use this instead of looking for a stylesheet PI. Also, setting the stylesheet is needed if you are going to use the processor as a SAX ContentHandler.

  Parameters:
    `stylesheetRoot` - A non-null StylesheetRoot object, or null if you wish to clear the stylesheet reference.

### getStylesheet

    public final StylesheetRoot getStylesheet()

  Get the current stylesheet for this processor.

  Returns:
    The stylesheet that is associated with this transformer.

### getQuietConflictWarnings

    public boolean getQuietConflictWarnings()

  Get quietConflictWarnings property. If the quietConflictWarnings property is set to true, warnings about pattern conflicts won't be printed to the diagnostics stream.

  Returns:
    True if this transformer should not report template match conflicts.

### setQuietConflictWarnings

    public void setQuietConflictWarnings(boolean b)

  If the quietConflictWarnings property is set to true, warnings about pattern conflicts won't be printed to the diagnostics stream. False by default. (Currently setting this property will have no effect.)

  Parameters:
    `b` - true if conflict warnings should be suppressed.

### setXPathContext

    public void setXPathContext(XPathContext xcontext)

  Set the execution context for XPath.

  Parameters:
    `xcontext` - A non-null reference to the XPathContext associated with this transformer.

### getXPathContext

    public final XPathContext getXPathContext()

  Get the XPath context associated with this transformer.

  Returns:
    The XPathContext reference, never null.

### getStackGuard

    public StackGuard getStackGuard()

  Get the object used to guard the stack from recursion.

  Returns:
    The StackGuard object, which should never be null.

### getRecursionLimit

    public int getRecursionLimit()

  Get the recursion limit. Used for infinite loop check. If the value is -1, do not check for infinite loops. Anyone who wants to enable that check should change the value of this variable to be the level of recursion that they want to check. Be careful setting this variable, if the number is too low, it may report an infinite loop situation, when there is none. Post version 1.0.0, we'll make this a runtime feature.

  Returns:
    The limit on recursion, or -1 if no check is to be made.

### setRecursionLimit

    public void setRecursionLimit(int limit)

  Set the recursion limit. Used for infinite loop check. If the value is -1, do not check for infinite loops. Anyone who wants to enable that check should change the value of this variable to be the level of recursion that they want to check. Be careful setting this variable, if the number is too low, it may report an infinite loop situation, when there is none. Post version 1.0.0, we'll make this a runtime feature.

  Parameters:
    `limit` - A number that represents the limit of recursion, or -1 if no checking is to be done.

### getResultTreeHandler

    public ResultTreeHandler getResultTreeHandler()

  Get the ResultTreeHandler object.

  Returns:
    The current ResultTreeHandler, which may not be the main result tree manager.

### getKeyManager

    public KeyManager getKeyManager()

  Get the KeyManager object.

  Returns:
    A reference to the KeyManager object, which should never be null.

### isRecursiveAttrSet

    public boolean isRecursiveAttrSet(ElemAttributeSet attrSet)

  Check to see if this is a recursive attribute definition.

  Parameters:
    `attrSet` - A non-null ElemAttributeSet reference.
  Returns:
    true if the attribute set is recursive.

### pushElemAttributeSet

    public void pushElemAttributeSet(ElemAttributeSet attrSet)

  Push an executing attribute set, so we can check for recursive attribute definitions.

  Parameters:
    `attrSet` - A non-null ElemAttributeSet reference.

### popElemAttributeSet

    public void popElemAttributeSet()

  Pop the current executing attribute set.

### getCountersTable

    public CountersTable getCountersTable()

  Get the table of counters, for optimized xsl:number support.

  Returns:
    The CountersTable, never null.

### currentTemplateRuleIsNull

    public boolean currentTemplateRuleIsNull()

  Tell if the current template rule is null, i.e. if we are directly within an apply-templates. Used for xsl:apply-imports.

  Returns:
    True if the current template rule is null.

### pushCurrentTemplateRuleIsNull

    public void pushCurrentTemplateRuleIsNull(boolean b)

  Push true if the current template rule is null, false otherwise.

  Parameters:
    `b` - True if the we are executing an xsl:for-each (or xsl:call-template?).

### popCurrentTemplateRuleIsNull

    public void popCurrentTemplateRuleIsNull()

  Push true if the current template rule is null, false otherwise.

### getMsgMgr

    public MsgMgr getMsgMgr()

  Return the message manager.

  Returns:
    The message manager, never null.

### setErrorListener

    public void setErrorListener(javax.xml.transform.ErrorListener listener)
                          throws java.lang.IllegalArgumentException

  Set the error event listener.

  Parameters:
    `listener` - The new error listener.
  Throws:
    java.lang.IllegalArgumentException - if
  Overrides:
    setErrorListener in class javax.xml.transform.Transformer

### getErrorListener

    public javax.xml.transform.ErrorListener getErrorListener()

  Get the current error event handler.

  Returns:
    The current error handler, which should never be null.
  Overrides:
    getErrorListener in class javax.xml.transform.Transformer

### getTraceManager

    public TraceManager getTraceManager()

  Get an instance of the trace manager for this transformation. This object can be used to set trace listeners on various events during the transformation.

  Returns:
    A reference to the TraceManager, never null.

### getFeature

    public boolean getFeature(java.lang.String name)
                       throws org.xml.sax.SAXNotRecognizedException,
                              org.xml.sax.SAXNotSupportedException

  Look up the value of a feature.

  The feature name is any fully-qualified URI. It is possible for an TransformerFactory to recognize a feature name but to be unable to return its value; this is especially true in the case of an adapter for a SAX1 Parser, which has no way of knowing whether the underlying parser is validating, for example.

  ### Open issues:

  #### Should getFeature be changed to hasFeature?

    Keith Visco writes: Should getFeature be changed to hasFeature? It returns a boolean which indicated whether the "state" of feature is "true or false". I assume this means whether or not a feature is supported? I know SAX is using "getFeature", but to me "hasFeature" is cleaner.

  Parameters:
    `name` - The feature name, which is a fully-qualified URI.
  Returns:
    The current state of the feature (true or false).
  Throws:
    org.xml.sax.SAXNotRecognizedException - When the TransformerFactory does not recognize the feature name.
    org.xml.sax.SAXNotSupportedException - When the TransformerFactory recognizes the feature name but cannot determine its value at this time.
    org.xml.sax.SAXNotRecognizedException -
    org.xml.sax.SAXNotSupportedException -

### getMode

    public QName getMode()

  NEEDSDOC Method getMode NEEDSDOC (getMode) @return

### pushMode

    public void pushMode(QName mode)

  NEEDSDOC Method pushMode NEEDSDOC @param mode

### popMode

    public void popMode()

  NEEDSDOC Method popMode

### setThreadControler

    public static void setThreadControler(TransformerImpl.ThreadControler tp)

  Change the ThreadControler that will be used to manage the transform threads. NEEDSDOC @param tp

### runTransformThread

    public void runTransformThread(int priority)

  Called by SourceTreeHandler to start the transformation in a separate thread NEEDSDOC @param priority

### runTransformThread

    public void runTransformThread()

  Called by this.transform() if isParserEventsOnMain()==false. Similar with runTransformThread(), but no priority is set and setTransformThread is not set.

### runTransformThread

    public static void runTransformThread(java.lang.Runnable runnable)

  Called by CoRoutineSAXParser. Launches the CoroutineSAXParser in a thread, and prepares it to invoke the parser from that thread upon request.

### waitTransformThread

    public void waitTransformThread()
                             throws org.xml.sax.SAXException

  Used by SourceTreeHandler to wait until the transform completes

  Throws:
    org.xml.sax.SAXException -

### getExceptionThrown

    public java.lang.Exception getExceptionThrown()

  Get the exception thrown by the secondary thread (normally the transform thread).

  Returns:
    The thrown exception, or null if no exception was thrown.

### setExceptionThrown

    public void setExceptionThrown(java.lang.Exception e)

  Set the exception thrown by the secondary thread (normally the transform thread).

  Parameters:
    `e` - The thrown exception, or null if no exception was thrown.

### setSourceTreeDocForThread

    public void setSourceTreeDocForThread(int doc)

  This is just a way to set the document for run().

  Parameters:
    `doc` - A non-null reference to the root of the tree to be transformed.

### setXMLSource

    public void setXMLSource(javax.xml.transform.Source source)

  Set the input source for the source tree, which is needed if the parse thread is not the main thread, in order for the parse thread's run method to get to the input source.

  Parameters:
    `source` - The input source for the source tree.

### isTransformDone

    public boolean isTransformDone()

  Tell if the transform method is completed.

  Returns:
    True if transformNode has completed, or an exception was thrown.

### setIsTransformDone

    public void setIsTransformDone(boolean done)

  Set if the transform method is completed.

  Parameters:
    `done` - True if transformNode has completed, or an exception was thrown.

### run

    public void run()

  Run the transform thread.
  Specified by:
    run in interface java.lang.Runnable

### getSnapshot

    public TransformSnapshot getSnapshot()

  This will get a snapshot of the current executing context

  Returns:
    TransformerSnapshot object, snapshot of executing context

### executeFromSnapshot

    public void executeFromSnapshot(TransformSnapshot ts)
                             throws javax.xml.transform.TransformerException

  This will execute the following XSLT instructions from the snapshot point, after the stylesheet execution context has been reset from the snapshot point.

  Parameters:
    `ts` - The snapshot of where to start execution
  Throws:
    javax.xml.transform.TransformerException -

### resetToStylesheet

    public void resetToStylesheet(TransformSnapshot ts)

  This will reset the stylesheet execution context from the snapshot point.

  Parameters:
    `ts` - The snapshot of where to start execution

### stopTransformation

    public void stopTransformation()

  NEEDSDOC Method stopTransformation

### getShouldStripSpace

    public short getShouldStripSpace(int elementHandle,
                                     weblogic.apache.xml.dtm.DTM dtm)

  Test whether whitespace-only text nodes are visible in the logical view of `DTM`. Normally, this function will be called by the implementation of `DTM`; it is not normally called directly from user code.
  Specified by:
    getShouldStripSpace in interface weblogic.apache.xml.dtm.DTMWSFilter

  Parameters:
    `elementHandle` - int Handle of the element.
  Returns:
    one of NOTSTRIP, STRIP, or INHERIT.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Documentation is available at http://e-docs.bea.com/wls/docs70
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004 BEA Systems, Inc. All Rights Reserved.
WebLogic Server 7.0 API Reference