1 16 19 package org.apache.xalan.templates; 20 21 import javax.xml.transform.TransformerException ; 22 23 import org.apache.xalan.transformer.TransformerImpl; 24 import org.apache.xpath.VariableStack; 25 import org.apache.xpath.objects.XObject; 26 27 39 public class ElemParam extends ElemVariable 40 { 41 int m_qnameID; 42 43 47 public ElemParam(){} 48 49 55 public int getXSLToken() 56 { 57 return Constants.ELEMNAME_PARAMVARIABLE; 58 } 59 60 65 public String getNodeName() 66 { 67 return Constants.ELEMNAME_PARAMVARIABLE_STRING; 68 } 69 70 77 public ElemParam(ElemParam param) throws TransformerException 78 { 79 super(param); 80 } 81 82 88 public void compose(StylesheetRoot sroot) throws TransformerException 89 { 90 super.compose(sroot); 91 m_qnameID = sroot.getComposeState().getQNameID(m_qname); 92 int parentToken = m_parentNode.getXSLToken(); 93 if (parentToken == Constants.ELEMNAME_TEMPLATE 94 || parentToken == Constants.EXSLT_ELEMNAME_FUNCTION) 95 ((ElemTemplate)m_parentNode).m_inArgsSize++; 96 } 97 98 108 public void execute(TransformerImpl transformer) throws TransformerException 109 { 110 if (TransformerImpl.S_DEBUG) 111 transformer.getTraceManager().fireTraceEvent(this); 112 113 VariableStack vars = transformer.getXPathContext().getVarStack(); 114 115 if(!vars.isLocalSet(m_index)) 116 { 117 118 int sourceNode = transformer.getXPathContext().getCurrentNode(); 119 XObject var = getValue(transformer, sourceNode); 120 121 transformer.getXPathContext().getVarStack().setLocalVariable(m_index, var); 123 } 124 125 if (TransformerImpl.S_DEBUG) 126 transformer.getTraceManager().fireTraceEndEvent(this); 127 } 128 129 } 130 | Popular Tags |