org.apache.xalan.transformer

Interface TransformState

public interface TransformState extends TransformStateSetter

This interface is meant to be used by a consumer of SAX2 events produced by Xalan, and enables the consumer to get information about the state of the transform. It is primarily intended as a tooling interface. A content handler can get a reference to a TransformState by implementing the TransformerClient interface. Xalan will check for that interface before it calls startDocument, and, if it is implemented, pass in a TransformState reference to the setTransformState method.

Note that the current stylesheet and root stylesheet can be retrieved from the ElemTemplateElement obtained from either getCurrentElement() or getCurrentTemplate().

This interface contains only getter methods, any setters are in the interface TransformStateSetter which this interface extends.

See Also: TransformStateSetter

Method Summary
NodeIteratorgetContextNodeList()
Get the current context node list.
ElemTemplateElementgetCurrentElement()
Retrieves the stylesheet element that produced the SAX event.
NodegetCurrentNode()
This method retrieves the current context node in the source tree.
ElemTemplategetCurrentTemplate()
This method retrieves the xsl:template that is in effect, which may be a matched template or a named template.
NodegetMatchedNode()
Retrieves the node in the source tree that matched the template obtained via getMatchedTemplate().
ElemTemplategetMatchedTemplate()
This method retrieves the xsl:template that was matched.
TransformergetTransformer()
Get the TrAX Transformer object in effect.

Method Detail

getContextNodeList

public NodeIterator getContextNodeList()
Get the current context node list.

Returns: the current context node list.

getCurrentElement

public ElemTemplateElement getCurrentElement()
Retrieves the stylesheet element that produced the SAX event.

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

Returns: the stylesheet element that produced the SAX event.

getCurrentNode

public Node getCurrentNode()
This method retrieves the current context node in the source tree.

Returns: the current context node in the source tree.

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 xsl:template that is in effect

getMatchedNode

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

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

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.

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

Returns: the xsl:template that was matched.

getTransformer

public Transformer getTransformer()
Get the TrAX Transformer object in effect.

Returns: the TrAX Transformer object in effect.

Copyright B) 2006 Apache XML Project. All Rights Reserved.