2
* Licensed to the Apache Software Foundation (ASF) under one
3
* or more contributor license agreements. See the NOTICE file
4
* distributed with this work for additional information
5
* regarding copyright ownership. The ASF licenses this file
6
* to you under the Apache License, Version 2.0 (the "License");
7
* you may not use this file except in compliance with the License.
8
* You may obtain a copy of the License at
10
* http://www.apache.org/licenses/LICENSE-2.0
12
* Unless required by applicable law or agreed to in writing, software
13
* distributed under the License is distributed on an "AS IS" BASIS,
14
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
* See the License for the specific language governing permissions and
16
* limitations under the License.
19
* $Id: TransformState.java,v 1.2 2009/12/10 03:18:25 matthewoliver Exp $
21
package org.apache.xalan.transformer;
23
import javax.xml.transform.Transformer;
25
import org.apache.xalan.templates.ElemTemplate;
26
import org.apache.xalan.templates.ElemTemplateElement;
27
import org.apache.xml.serializer.TransformStateSetter;
29
import org.w3c.dom.Node;
30
import org.w3c.dom.traversal.NodeIterator;
33
* This interface is meant to be used by a consumer of
34
* SAX2 events produced by Xalan, and enables the consumer
35
* to get information about the state of the transform. It
36
* is primarily intended as a tooling interface. A content
37
* handler can get a reference to a TransformState by implementing
38
* the TransformerClient interface. Xalan will check for
39
* that interface before it calls startDocument, and, if it
40
* is implemented, pass in a TransformState reference to the
41
* setTransformState method.
43
* <p>Note that the current stylesheet and root stylesheet can
44
* be retrieved from the ElemTemplateElement obtained from
45
* either getCurrentElement() or getCurrentTemplate().</p>
47
* This interface contains only getter methods, any setters are in the interface
48
* TransformStateSetter which this interface extends.
50
* @see org.apache.xml.serializer.TransformStateSetter
52
public interface TransformState extends TransformStateSetter
56
* Retrieves the stylesheet element that produced
59
* <p>Please note that the ElemTemplateElement returned may
60
* be in a default template, and thus may not be
61
* defined in the stylesheet.</p>
63
* @return the stylesheet element that produced the SAX event.
65
ElemTemplateElement getCurrentElement();
68
* This method retrieves the current context node
71
* @return the current context node in the source tree.
73
Node getCurrentNode();
76
* This method retrieves the xsl:template
77
* that is in effect, which may be a matched template
78
* or a named template.
80
* <p>Please note that the ElemTemplate returned may
81
* be a default template, and thus may not have a template
82
* defined in the stylesheet.</p>
84
* @return the xsl:template that is in effect
86
ElemTemplate getCurrentTemplate();
89
* This method retrieves the xsl:template
90
* that was matched. Note that this may not be
91
* the same thing as the current template (which
92
* may be from getCurrentElement()), since a named
93
* template may be in effect.
95
* <p>Please note that the ElemTemplate returned may
96
* be a default template, and thus may not have a template
97
* defined in the stylesheet.</p>
99
* @return the xsl:template that was matched.
101
ElemTemplate getMatchedTemplate();
104
* Retrieves the node in the source tree that matched
105
* the template obtained via getMatchedTemplate().
107
* @return the node in the source tree that matched
108
* the template obtained via getMatchedTemplate().
110
Node getMatchedNode();
113
* Get the current context node list.
115
* @return the current context node list.
117
NodeIterator getContextNodeList();
120
* Get the TrAX Transformer object in effect.
122
* @return the TrAX Transformer object in effect.
124
Transformer getTransformer();