org.apache.xalan.transformer
Class TransformerImpl

java.lang.Object
  |
  +--org.xml.sax.helpers.XMLFilterImpl
        |
        +--org.apache.xalan.transformer.TransformerImpl

public class TransformerImpl
extends XMLFilterImpl
implements Transformer, java.lang.Runnable, TransformState

**For advanced use only** The Xalan workhorse -- Collaborates with the XPath xcontext, the DOM, and the XPath engine, to transform a source tree of nodes into a result tree according to instructions and templates specified by a stylesheet tree. We suggest you use one of the static XSLTProcessorFactory getProcessor() methods to instantiate the processor and return an interface that greatly simplifies the process of manipulating TransformerImpl.

The methods process(...) are the primary public entry points. The best way to perform transformations is to use the XSLTProcessor#process(XSLTInputSource, XSLTInputSource, XSLTResultTarget) method, but you may use any of process methods defined in TransformerImpl.

Please note that this class is not safe per instance over multiple threads. If you are in a multithreaded environment, you should keep a pool of these objects, or create a new one each time. In a multithreaded environment, the right way to do things is to create a StylesheetRoot via processStylesheet, and then reuse this object over multiple threads.

If you reuse the processor instance, you should call reset() between transformations.

See Also:
XSLTProcessorFactory, XSLTProcessor

Field Summary
static boolean S_DEBUG
          **For advanced use only** This is a compile-time flag to turn off calling of trace listeners.
 
Constructor Summary
TransformerImpl(StylesheetRoot stylesheet)
          **For advanced use only** Construct a TransformerImpl.
 
Method Summary
 ContentHandler createResultContentHandler(Result outputTarget)
          **For advanced use only** Create a ContentHandler from a Result object.
 ContentHandler createResultContentHandler(Result outputTarget, OutputFormat format)
          **For advanced use only** Create a ContentHandler from a Result object.
 boolean currentTemplateRuleIsNull()
          **For advanced use only** Tell if the current template rule is null.
 void executeChildTemplates(ElemTemplateElement elem, Node sourceNode, QName mode)
          **For advanced use only** Execute each of the children of a template element.
 void executeChildTemplates(ElemTemplateElement elem, Node sourceNode, QName mode, ContentHandler handler)
          **For advanced use only** Execute each of the children of a template element.
 java.lang.String getBaseURLOfSource()
          **For advanced use only** Get the base URL of the source.
 NodeIterator getContextNodeList()
          **For advanced use only** Get the current context node list.
 CountersTable getCountersTable()
          **For advanced use only** Get the table of counters, for optimized xsl:number support.
 ElemTemplateElement getCurrentElement()
          **For advanced use only** Retrieves the stylesheet element that produced the SAX event.
 Node getCurrentNode()
          **For advanced use only** This method retrieves the current context node in the source tree.
 ElemTemplate getCurrentTemplate()
          **For advanced use only** This method retrieves the xsl:template that is in effect, which may be a matched template or a named template.
 java.lang.Exception getExceptionThrown()
          **For advanced use only**  
 boolean getFeature(java.lang.String name)
          **For advanced use only** Look up the value of a feature.
 ContentHandler getInputContentHandler()
          **For advanced use only** Get a SAX2 ContentHandler for the input.
 org.xml.sax.ext.DeclHandler getInputDeclHandler()
          **For advanced use only** Get a SAX2 DeclHandler for the input.
 org.xml.sax.ext.LexicalHandler getInputLexicalHandler()
          **For advanced use only** Get a SAX2 LexicalHandler for the input.
 KeyManager getKeyManager()
          **For advanced use only** Get the KeyManager object.
 Node getMatchedNode()
          **For advanced use only** Retrieves the node in the source tree that matched the template obtained via getMatchedTemplate().
 ElemTemplate getMatchedTemplate()
          **For advanced use only** This method retrieves the xsl:template that was matched.
 MsgMgr getMsgMgr()
          **For advanced use only** Return the message manager.
 OutputFormat getOutputFormat()
          **For advanced use only** Get the output properties used for the transformation.
 java.lang.Object getProperty(java.lang.String name)
          **For advanced use only** Get the value of a property.
 boolean getQuietConflictWarnings()
          **For advanced use only** Get quietConflictWarnings property.
 int getRecursionLimit()
          **For advanced use only** Get the recursion limit.
 ResultTreeHandler getResultTreeHandler()
          **For advanced use only** Get the ResultTreeHandler object.
 Serializer getSerializer()
          **For advanced use only**  
 StackGuard getStackGuard()
          **For internal use only** Get the object used to guard the stack from recursion.
 ObjectPool getStringWriterPool()
          **For internal use only**
 StylesheetRoot getStylesheet()
          **For advanced use only** Get the current stylesheet for this processor.
 TraceManager getTraceManager()
          **For advanced use only** Get an instance of the trace manager for this transformation.
 Transformer getTransformer()
          **For advanced use only** Get the TrAX Transformer object in effect.
 java.lang.Thread getTransformThread()
          **For internal use only** Get the thread that the transform process is on.
 XPathContext getXPathContext()
          **For advanced use only** Get the XML Parser Liaison that this processor uses.
 boolean isParserEventsOnMain()
          **For advanced use only** Get true if the parser events should be on the main thread, false if not.
 boolean isRecursiveAttrSet(ElemAttributeSet attrSet)
          **For advanced use only** Check to see if this is a recursive attribute definition.
 boolean isTransformDone()
          **For advanced use only**  
 void parse(InputSource xmlSource)
          **For advanced use only** Transform a document.
 Node parseToNode(InputSource xmlSource)
          **For advanced use only** Process the an input source to a DOM node.
 void popCurrentTemplateRuleIsNull()
          **For advanced use only** Push true if the current template rule is null, false otherwise.
 void popElemAttributeSet()
          **For advanced use only** Pop the current executing attribute set.
 void popElemTemplateElement()
          **For advanced use only** Pop the current template element.
 void pushCurrentTemplateRuleIsNull(boolean b)
          **For advanced use only** Push true if the current template rule is null, false otherwise.
 void pushElemAttributeSet(ElemAttributeSet attrSet)
          **For advanced use only** Push an executing attribute set, so we can check for recursive attribute definitions.
 void pushElemTemplateElement(ElemTemplateElement elem, Node currentNode)
          **For advanced use only** Push the current template element.
 void pushParams(Stylesheet stylesheetTree, ElemTemplateElement xslCallTemplateElement, Node sourceNode, QName mode)
          **For advanced use only** Given a template, search for the arguments and push them on the stack.
 void reset()
          **For advanced use only** Reset the state.
 void resetParameters()
          **For advanced use only** Reset the parameters to a null list.
 void run()
          **For advanced use only** Run the transform thread.
 void setContentHandler(ContentHandler handler)
          **For advanced use only** Allow an application to register a content event handler.
 void setEntityResolver(EntityResolver resolver)
          **For advanced use only**  
 void setOutputFormat(OutputFormat oformat)
          **For advanced use only** Set the output properties for the transformation.
 void setParameter(java.lang.String name, java.lang.String namespace, java.lang.Object value)
          **For advanced use only** Set a parameter for the templates.
 void setParent(XMLReader parent)
          **For advanced use only** Set the parent reader.
 void setProperty(java.lang.String name, java.lang.Object value)
          **For advanced use only** Set the value of a property.
 void setQuietConflictWarnings(boolean b)
          **For advanced use only** If the quietConflictWarnings property is set to true, warnings about pattern conflicts won't be printed to the diagnostics stream.
 void setRecursionLimit(int limit)
          **For advanced use only** Get the recursion limit.
 void setSerializer(Serializer s)
          **For advanced use only**  
 void setSourceTreeDocForThread(Node doc)
          **For advanced use only** This is just a way to set the document for run().
 void setStylesheet(StylesheetRoot stylesheetRoot)
          **For advanced use only** Set the stylesheet for this processor.
 void setTransformThread(java.lang.Thread t)
          **For internal use only** Get the thread that the transform process is on.
 void setURIResolver(URIResolver resolver)
          **For advanced use only** Set an object that will be used to resolve URIs used in document(), etc.
 void setXPathContext(XPathContext xcontext)
          **For advanced use only** Set the execution context for XPath.
 void transform(InputSource xmlSource)
          **For advanced use only** Process the source tree to SAX parse events.
 void transform(InputSource xmlSource, Result outputTarget)
          **For advanced use only** Process the source tree to the output result.
 boolean transformNode(ElemTemplateElement xslInstruction, ElemTemplateElement template, Node child, QName mode)
          **For advanced use only** Given an element and mode, find the corresponding template and process the contents.
 void transformNode(Node node)
          **For advanced use only** Process the source node to the output result, if the processor supports the "http://xml.org/trax/features/dom/input" feature.
 void transformNode(Node node, Result outputTarget)
          **For advanced use only** Process the source node to the output result, if the processor supports the "http://xml.org/trax/features/dom/input" feature.
 void transformSelectedNodes(StylesheetComposed stylesheetTree, ElemTemplateElement xslInstruction, ElemTemplateElement template, Node sourceNodeContext, QName mode, XPath selectPattern, int selectStackFrameIndex)
          **For advanced use only** Perform a query if needed, and call transformNode for each child.
 DocumentFragment transformToRTF(Stylesheet stylesheetTree, ElemTemplateElement templateParent, Node sourceNode, QName mode)
          **For advanced use only** Given a stylesheet element, create a result tree fragment from it's contents.
 java.lang.String transformToString(ElemTemplateElement elem, Node sourceNode, QName mode)
          **For advanced use only** Take the contents of a template element, process it, and convert it to a string.
 
Methods inherited from class org.xml.sax.helpers.XMLFilterImpl
characters, endDocument, endElement, endPrefixMapping, error, fatalError, getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getParent, ignorableWhitespace, notationDecl, parse, processingInstruction, resolveEntity, setDocumentLocator, setDTDHandler, setErrorHandler, setFeature, skippedEntity, startDocument, startElement, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

S_DEBUG

public static boolean S_DEBUG
**For advanced use only** This is a compile-time flag to turn off calling of trace listeners. Set this to false for optimization purposes.
Constructor Detail

TransformerImpl

public TransformerImpl(StylesheetRoot stylesheet)
**For advanced use only** Construct a TransformerImpl.
Parameters:
stylesheet - The root of the stylesheet tree.
Method Detail

reset

public void reset()
**For advanced use only** Reset the state. This needs to be called after a process() call is invoked, if the processor is to be used again.

parse

public void parse(InputSource xmlSource)
           throws SAXException,
                  java.io.IOException
**For advanced use only** Transform a document.
Parameters:
input - The input source for the document entity.
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.
java.io.IOException - An IO exception from the parser, possibly from a byte stream or character stream supplied by the application.
Overrides:
parse in class XMLFilterImpl
See Also:
XMLReader.parse(org.xml.sax.InputSource)

isParserEventsOnMain

public boolean isParserEventsOnMain()
**For advanced use only** Get true if the parser events should be on the main thread, false if not. Experemental. Can not be set right now.

getTransformThread

public java.lang.Thread getTransformThread()
**For internal use only** Get the thread that the transform process is on. This may return null.

setTransformThread

public void setTransformThread(java.lang.Thread t)
**For internal use only** Get the thread that the transform process is on. This may return null.

transform

public void transform(InputSource xmlSource)
               throws TransformException
**For advanced use only** Process the source tree to SAX parse events.
Specified by:
transform in interface Transformer
Parameters:
xmlSource - The input for the source tree.

getBaseURLOfSource

public java.lang.String getBaseURLOfSource()
**For advanced use only** Get the base URL of the source.

getProperty

public java.lang.Object getProperty(java.lang.String name)
                             throws SAXNotRecognizedException,
                                    SAXNotSupportedException
**For advanced use only** Get 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.
Throws:
SAXNotRecognizedException - When the XMLReader does not recognize the property name.
SAXNotSupportedException - When the XMLReader recognizes the property name but cannot set the requested value.
Overrides:
getProperty in class XMLFilterImpl

setProperty

public void setProperty(java.lang.String name,
                        java.lang.Object value)
                 throws SAXNotRecognizedException,
                        SAXNotSupportedException
**For advanced use only** 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:
SAXNotRecognizedException - When the XMLReader does not recognize the property name.
SAXNotSupportedException - When the XMLReader recognizes the property name but cannot set the requested value.
Overrides:
setProperty in class XMLFilterImpl

parseToNode

public Node parseToNode(InputSource xmlSource)
                 throws TransformException
**For advanced use only** Process the an input source to a DOM node. FOR INTERNAL USE ONLY.
Parameters:
xmlSource - The input for the source tree.

createResultContentHandler

public ContentHandler createResultContentHandler(Result outputTarget)
                                          throws TransformException
**For advanced use only** Create a ContentHandler from a Result object.

createResultContentHandler

public ContentHandler createResultContentHandler(Result outputTarget,
                                                 OutputFormat format)
                                          throws TransformException
**For advanced use only** Create a ContentHandler from a Result object.

transform

public void transform(InputSource xmlSource,
                      Result outputTarget)
               throws TransformException
**For advanced use only** Process the source tree to the output result.
Specified by:
transform in interface Transformer
Parameters:
xmlSource - The input for the source tree.
outputTarget - The output source target.

transformNode

public void transformNode(Node node,
                          Result outputTarget)
                   throws TransformException
**For advanced use only** Process the source node to the output result, if the processor supports the "http://xml.org/trax/features/dom/input" feature.
Specified by:
transformNode in interface Transformer
Parameters:
node - The input source node, which can be any valid DOM node.
outputTarget - The output source target.

transformNode

public void transformNode(Node node)
                   throws TransformException
**For advanced use only** Process the source node to the output result, if the processor supports the "http://xml.org/trax/features/dom/input" feature.
Specified by:
transformNode in interface Transformer
Parameters:
node - The input source node, which can be any valid DOM node.
outputTarget - The output source target.

getInputContentHandler

public ContentHandler getInputContentHandler()
**For advanced use only** Get a SAX2 ContentHandler for the input.
Specified by:
getInputContentHandler in interface Transformer
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()
**For advanced use only** Get a SAX2 DeclHandler for the input.
Specified by:
getInputDeclHandler in interface Transformer
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()
**For advanced use only** Get a SAX2 LexicalHandler for the input.
Specified by:
getInputLexicalHandler in interface Transformer
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(OutputFormat oformat)
**For advanced use only** Set the output properties for the transformation. These properties will override properties set in the templates with xsl:output.
Specified by:
setOutputFormat in interface Transformer
See Also:
org.xml.org.apache.serialize.OutputFormat

getOutputFormat

public OutputFormat getOutputFormat()
**For advanced use only** Get the output properties used for the transformation.
See Also:
org.xml.org.apache.serialize.OutputFormat

getSerializer

public Serializer getSerializer()

setSerializer

public void setSerializer(Serializer s)

setParameter

public void setParameter(java.lang.String name,
                         java.lang.String namespace,
                         java.lang.Object value)
**For advanced use only** Set a parameter for the templates.
Specified by:
setParameter in interface Transformer
Parameters:
name - The name of the parameter.
namespace - The namespace of the parameter.

resetParameters

public void resetParameters()
**For advanced use only** Reset the parameters to a null list.
Specified by:
resetParameters in interface Transformer

pushParams

public void pushParams(Stylesheet stylesheetTree,
                       ElemTemplateElement xslCallTemplateElement,
                       Node sourceNode,
                       QName mode)
                throws SAXException
**For advanced use only** Given a template, search for the arguments and push them on the stack. Also, push default arguments on the stack. You must call popContext() when you are done with the arguments.

setURIResolver

public void setURIResolver(URIResolver resolver)
**For advanced use only** Set an object that will be used to resolve URIs used in document(), etc.
Specified by:
setURIResolver in interface Transformer
Parameters:
resolver - An object that implements the URIResolver interface, or null.

setEntityResolver

public void setEntityResolver(EntityResolver resolver)
Overrides:
setEntityResolver in class XMLFilterImpl

transformToRTF

public DocumentFragment transformToRTF(Stylesheet stylesheetTree,
                                       ElemTemplateElement templateParent,
                                       Node sourceNode,
                                       QName mode)
                                throws SAXException
**For advanced use only** Given a stylesheet element, create a result tree fragment from it's contents.
Parameters:
stylesheetTree - The stylesheet object that holds the fragment.
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.

getStringWriterPool

public ObjectPool getStringWriterPool()
**For internal use only**

transformToString

public java.lang.String transformToString(ElemTemplateElement elem,
                                          Node sourceNode,
                                          QName mode)
                                   throws SAXException
**For advanced use only** Take the contents of a template element, process it, and convert it to a string.
Parameters:
transformer - The XSLT transformer instance.
sourceNode - The current source node context.
mode - The current mode.
Returns:
The stringized result of executing the elements children.
Throws:
SAXException - Might be thrown from the document() function, or from xsl:include or xsl:import.

transformSelectedNodes

public void transformSelectedNodes(StylesheetComposed stylesheetTree,
                                   ElemTemplateElement xslInstruction,
                                   ElemTemplateElement template,
                                   Node sourceNodeContext,
                                   QName mode,
                                   XPath selectPattern,
                                   int selectStackFrameIndex)
                            throws SAXException
**For advanced use only** Perform a query if needed, and call transformNode for each child.
Parameters:
stylesheetTree - The owning stylesheet tree.
xslInstruction - The stylesheet element context (depricated -- I do not think we need this).
template - The owning template context.
sourceNodeContext - The current source node context.
mode - The current mode.
selectPattern - The XPath with which to perform the selection.
xslToken - The current XSLT instruction (depricated -- I do not think we want this).
tcontext - The TransformerImpl context.
selectStackFrameIndex - The stack frame context for executing the select statement.
Throws:
SAXException - Thrown in a variety of circumstances.

transformNode

public boolean transformNode(ElemTemplateElement xslInstruction,
                             ElemTemplateElement template,
                             Node child,
                             QName mode)
                      throws SAXException
**For advanced use only** Given an element and mode, find the corresponding template and process the contents.
Parameters:
stylesheetTree - The current Stylesheet object.
xslInstruction - The calling element.
template - The template to use if xsl:for-each, or null.
selectContext - The selection context.
child - The source context node.
mode - The current mode, may be null.
Returns:
true if applied a template, false if not.
Throws:
SAXException -  

executeChildTemplates

public void executeChildTemplates(ElemTemplateElement elem,
                                  Node sourceNode,
                                  QName mode,
                                  ContentHandler handler)
                           throws SAXException
**For advanced use only** Execute each of the children of a template element.
Parameters:
transformer - The XSLT transformer instance.
sourceNode - The current context node.
mode - The current mode.
Throws:
SAXException - Might be thrown from the document() function, or from xsl:include or xsl:import.

executeChildTemplates

public void executeChildTemplates(ElemTemplateElement elem,
                                  Node sourceNode,
                                  QName mode)
                           throws SAXException
**For advanced use only** Execute each of the children of a template element.
Parameters:
transformer - The XSLT transformer instance.
sourceNode - The current context node.
mode - The current mode.
Throws:
SAXException - Might be thrown from the document() function, or from xsl:include or xsl:import.

pushElemTemplateElement

public void pushElemTemplateElement(ElemTemplateElement elem,
                                    Node currentNode)
**For advanced use only** Push the current template element.

popElemTemplateElement

public void popElemTemplateElement()
**For advanced use only** Pop the current template element.

getCurrentElement

public ElemTemplateElement getCurrentElement()
**For advanced use only** Retrieves the stylesheet element that produced the SAX event.
Specified by:
getCurrentElement in interface TransformState

getCurrentNode

public Node getCurrentNode()
**For advanced use only** This method retrieves the current context node in the source tree.
Specified by:
getCurrentNode in interface TransformState

getCurrentTemplate

public ElemTemplate getCurrentTemplate()
**For advanced use only** 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.

Specified by:
getCurrentTemplate in interface TransformState

getMatchedTemplate

public ElemTemplate getMatchedTemplate()
**For advanced use only** 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.
Specified by:
getMatchedTemplate in interface TransformState

getMatchedNode

public Node getMatchedNode()
**For advanced use only** Retrieves the node in the source tree that matched the template obtained via getMatchedTemplate().
Specified by:
getMatchedNode in interface TransformState

getContextNodeList

public NodeIterator getContextNodeList()
**For advanced use only** Get the current context node list.
Specified by:
getContextNodeList in interface TransformState

getTransformer

public Transformer getTransformer()
**For advanced use only** Get the TrAX Transformer object in effect.
Specified by:
getTransformer in interface TransformState

setStylesheet

public void setStylesheet(StylesheetRoot stylesheetRoot)
**For advanced use only** 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.

getStylesheet

public StylesheetRoot getStylesheet()
**For advanced use only** Get the current stylesheet for this processor.

getQuietConflictWarnings

public boolean getQuietConflictWarnings()
**For advanced use only** Get quietConflictWarnings property.

setQuietConflictWarnings

public void setQuietConflictWarnings(boolean b)
**For advanced use only** If the quietConflictWarnings property is set to true, warnings about pattern conflicts won't be printed to the diagnostics stream. True by default.
Parameters:
b - true if conflict warnings should be suppressed.

setXPathContext

public void setXPathContext(XPathContext xcontext)
**For advanced use only** Set the execution context for XPath.

getXPathContext

public XPathContext getXPathContext()
**For advanced use only** Get the XML Parser Liaison that this processor uses.

getStackGuard

public StackGuard getStackGuard()
**For internal use only** Get the object used to guard the stack from recursion.

getRecursionLimit

public int getRecursionLimit()
**For advanced use only** 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.

setRecursionLimit

public void setRecursionLimit(int limit)
**For advanced use only** 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.

getResultTreeHandler

public ResultTreeHandler getResultTreeHandler()
**For advanced use only** Get the ResultTreeHandler object.

getKeyManager

public KeyManager getKeyManager()
**For advanced use only** Get the KeyManager object.

isRecursiveAttrSet

public boolean isRecursiveAttrSet(ElemAttributeSet attrSet)
**For advanced use only** Check to see if this is a recursive attribute definition.

pushElemAttributeSet

public void pushElemAttributeSet(ElemAttributeSet attrSet)
**For advanced use only** Push an executing attribute set, so we can check for recursive attribute definitions.

popElemAttributeSet

public void popElemAttributeSet()
**For advanced use only** Pop the current executing attribute set.

getCountersTable

public CountersTable getCountersTable()
**For advanced use only** Get the table of counters, for optimized xsl:number support.

currentTemplateRuleIsNull

public boolean currentTemplateRuleIsNull()
**For advanced use only** Tell if the current template rule is null.

pushCurrentTemplateRuleIsNull

public void pushCurrentTemplateRuleIsNull(boolean b)
**For advanced use only** Push true if the current template rule is null, false otherwise.

popCurrentTemplateRuleIsNull

public void popCurrentTemplateRuleIsNull()
**For advanced use only** Push true if the current template rule is null, false otherwise.

getMsgMgr

public MsgMgr getMsgMgr()
**For advanced use only** Return the message manager.

getTraceManager

public TraceManager getTraceManager()
**For advanced use only** 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.

setParent

public void setParent(XMLReader parent)
**For advanced use only** Set the parent reader.

This is the XMLReader from which this filter will obtain its events and to which it will pass its configuration requests. The parent may itself be another filter.

If there is no parent reader set, any attempt to parse or to set or get a feature or property will fail.

Parameters:
parent - The parent XML reader.
Throws:
java.lang.NullPointerException - If the parent is null.
Overrides:
setParent in class XMLFilterImpl

setContentHandler

public void setContentHandler(ContentHandler handler)
**For advanced use only** Allow an application to register a content event handler.

If the application does not register a content handler, all content events reported by the SAX parser will be silently ignored.

Applications may register a new or different handler in the middle of a parse, and the SAX parser must begin using the new handler immediately.

Parameters:
handler - The content handler.
Throws:
java.lang.NullPointerException - If the handler argument is null.
Overrides:
setContentHandler in class XMLFilterImpl
See Also:
XMLFilterImpl.getContentHandler()

getFeature

public boolean getFeature(java.lang.String name)
                   throws SAXNotRecognizedException,
                          SAXNotSupportedException
**For advanced use only** Look up the value of a feature.

The feature name is any fully-qualified URI. It is possible for an Processor 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:
SAXNotRecognizedException - When the Processor does not recognize the feature name.
SAXNotSupportedException - When the Processor recognizes the feature name but cannot determine its value at this time.
Overrides:
getFeature in class XMLFilterImpl

getExceptionThrown

public java.lang.Exception getExceptionThrown()

setSourceTreeDocForThread

public void setSourceTreeDocForThread(Node doc)
**For advanced use only** This is just a way to set the document for run().

isTransformDone

public boolean isTransformDone()

run

public void run()
**For advanced use only** Run the transform thread.
Specified by:
run in interface java.lang.Runnable


Copyright © 2000 Apache XML Project. All Rights Reserved.