KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * Copyright 1999-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: ElemVariablePsuedo.java,v 1.5 2004/02/16 20:32:32 minchau Exp $
18  */

19 package org.apache.xalan.templates;
20
21 import javax.xml.transform.TransformerException JavaDoc;
22
23 import org.apache.xalan.transformer.TransformerImpl;
24 import org.apache.xpath.XPath;
25
26 public class ElemVariablePsuedo extends ElemVariable
27 {
28   XUnresolvedVariableSimple m_lazyVar;
29     
30   /**
31    * Set the "select" attribute.
32    * If the variable-binding element has a select attribute,
33    * then the value of the attribute must be an expression and
34    * the value of the variable is the object that results from
35    * evaluating the expression. In this case, the content
36    * of the variable must be empty.
37    *
38    * @param v Value to set for the "select" attribute.
39    */

40   public void setSelect(XPath v)
41   {
42     super.setSelect(v);
43     m_lazyVar = new XUnresolvedVariableSimple(this);
44   }
45   
46   /**
47    * Execute a variable declaration and push it onto the variable stack.
48    * @see <a HREF="http://www.w3.org/TR/xslt#variables">variables in XSLT Specification</a>
49    *
50    * @param transformer non-null reference to the the current transform-time state.
51    * @param sourceNode non-null reference to the <a HREF="http://www.w3.org/TR/xslt#dt-current-node">current source node</a>.
52    * @param mode reference, which may be null, to the <a HREF="http://www.w3.org/TR/xslt#modes">current mode</a>.
53    *
54    * @throws TransformerException
55    */

56   public void execute(TransformerImpl transformer) throws TransformerException JavaDoc
57   {
58
59     // if (TransformerImpl.S_DEBUG)
60
// transformer.getTraceManager().fireTraceEvent(this);
61

62     // transformer.getXPathContext().getVarStack().pushVariable(m_qname, var);
63
transformer.getXPathContext().getVarStack().setLocalVariable(m_index, m_lazyVar);
64   }
65
66 }
67
68
Popular Tags