protected void pushGlobalVars(int contextNode) throws TransformerException {
  XPathContext xctxt=m_xcontext;
  VariableStack vs=xctxt.getVarStack();
  StylesheetRoot sr=getStylesheet();
  Vector vars=sr.getVariablesAndParamsComposed();
  int i=vars.size();
  vs.link(i);
  while (--i >= 0) {
    ElemVariable v=(ElemVariable)vars.elementAt(i);
    XObject xobj=new XUnresolvedVariable(v,contextNode,this,vs.getStackFrame(),0,true);
    if (null == vs.elementAt(i))     vs.setGlobalVariable(i,xobj);
  }
}

protected void pushGlobalVars ( int contextNode ) throws TransformerException { XPathContext xctxt = m_xcontext ; VariableStack vs = xctxt . getVarStack ( ) ; StylesheetRoot sr = getStylesheet ( ) ; Vector vars = sr . getVariablesAndParamsComposed ( ) ; int i = vars . size ( ) ; vs . link ( i ) ; while ( -- i >= 0 ) { ElemVariable v = ( ElemVariable ) vars . elementAt ( i ) ; XObject xobj = new XUnresolvedVariable ( v , contextNode , this , vs . getStackFrame ( ) , 0 , true ) ; if ( null == vs . elementAt ( i ) ) vs . setGlobalVariable ( i , xobj ) ; } }
internal - - push the global variables from the stylesheet onto the context ' s runtime variable stack . < p > if we encounter a variable that is already defined in the variable stack , we ignore it . this is because the second variable definition will be at a lower import precedence . presumably , global " variables at the same import precedence with the same name will have been caught during the recompose process . < p > however , if we encounter a parameter that is already defined in the variable stack , we need to see if this is a parameter whose value was supplied by a setparameter call . if so , we need to " receive " the one already in the stack , ignoring this one . if it is just an earlier xsl : param or xsl : variable definition , we ignore it using the same reasoning as explained above for the variable .
