KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > xalan > templates > XSLTVisitor


1 /*
2  * Copyright 2002-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 /*
17  * $Id: XSLTVisitor.java,v 1.7 2004/02/16 20:32:32 minchau Exp $
18  */

19 package org.apache.xalan.templates;
20
21 import org.apache.xpath.XPathVisitor;
22
23 /**
24  * A derivation from this class can be passed to a class that implements
25  * the XSLTVisitable interface, to have the appropriate method called
26  * for each component of an XSLT stylesheet. Aside from possible other uses,
27  * the main intention is to provide a reasonable means to perform expression
28  * rewriting.
29  */

30 public class XSLTVisitor extends XPathVisitor
31 {
32     /**
33      * Visit an XSLT instruction. Any element that isn't called by one
34      * of the other visit methods, will be called by this method.
35      *
36      * @param elem The xsl instruction element object.
37      * @return true if the sub expressions should be traversed.
38      */

39     public boolean visitInstruction(ElemTemplateElement elem)
40     {
41         return true;
42     }
43     
44     /**
45      * Visit an XSLT stylesheet instruction.
46      *
47      * @param elem The xsl instruction element object.
48      * @return true if the sub expressions should be traversed.
49      */

50     public boolean visitStylesheet(ElemTemplateElement elem)
51     {
52         return true;
53     }
54
55     
56     /**
57      * Visit an XSLT top-level instruction.
58      *
59      * @param elem The xsl instruction element object.
60      * @return true if the sub expressions should be traversed.
61      */

62     public boolean visitTopLevelInstruction(ElemTemplateElement elem)
63     {
64         return true;
65     }
66     
67     /**
68      * Visit an XSLT top-level instruction.
69      *
70      * @param elem The xsl instruction element object.
71      * @return true if the sub expressions should be traversed.
72      */

73     public boolean visitTopLevelVariableOrParamDecl(ElemTemplateElement elem)
74     {
75         return true;
76     }
77
78     
79     /**
80      * Visit an XSLT variable or parameter declaration.
81      *
82      * @param elem The xsl instruction element object.
83      * @return true if the sub expressions should be traversed.
84      */

85     public boolean visitVariableOrParamDecl(ElemVariable elem)
86     {
87         return true;
88     }
89     
90     /**
91      * Visit a LiteralResultElement.
92      *
93      * @param elem The literal result object.
94      * @return true if the sub expressions should be traversed.
95      */

96     public boolean visitLiteralResultElement(ElemLiteralResult elem)
97     {
98         return true;
99     }
100     
101     /**
102      * Visit an Attribute Value Template (at the top level).
103      *
104      * @param owner The owner of the expression, to which the expression can
105      * be reset if rewriting takes place.
106      * @param elem The attribute value template object.
107      * @return true if the sub expressions should be traversed.
108      */

109     public boolean visitAVT(AVT elem)
110     {
111         return true;
112     }
113
114
115     /**
116      * Visit an extension element.
117      * @param elem The extension object.
118      * @return true if the sub expressions should be traversed.
119      */

120     public boolean visitExtensionElement(ElemExtensionCall elem)
121     {
122         return true;
123     }
124
125 }
126
127
Popular Tags