1. package org.apache.xalan.templates;
  2. import javax.xml.transform.TransformerException;
  3. import org.apache.xalan.transformer.TransformerImpl;
  4. import org.apache.xpath.XPath;
  5. public class ElemVariablePsuedo extends ElemVariable
  6. {
  7. XUnresolvedVariableSimple m_lazyVar;
  8. /**
  9. * Set the "select" attribute.
  10. * If the variable-binding element has a select attribute,
  11. * then the value of the attribute must be an expression and
  12. * the value of the variable is the object that results from
  13. * evaluating the expression. In this case, the content
  14. * of the variable must be empty.
  15. *
  16. * @param v Value to set for the "select" attribute.
  17. */
  18. public void setSelect(XPath v)
  19. {
  20. super.setSelect(v);
  21. m_lazyVar = new XUnresolvedVariableSimple(this);
  22. }
  23. /**
  24. * Execute a variable declaration and push it onto the variable stack.
  25. * @see <a href="http://www.w3.org/TR/xslt#variables">variables in XSLT Specification</a>
  26. *
  27. * @param transformer non-null reference to the the current transform-time state.
  28. * @param sourceNode non-null reference to the <a href="http://www.w3.org/TR/xslt#dt-current-node">current source node</a>.
  29. * @param mode reference, which may be null, to the <a href="http://www.w3.org/TR/xslt#modes">current mode</a>.
  30. *
  31. * @throws TransformerException
  32. */
  33. public void execute(TransformerImpl transformer) throws TransformerException
  34. {
  35. // if (TransformerImpl.S_DEBUG)
  36. // transformer.getTraceManager().fireTraceEvent(this);
  37. // transformer.getXPathContext().getVarStack().pushVariable(m_qname, var);
  38. transformer.getXPathContext().getVarStack().setLocalVariable(m_index, m_lazyVar);
  39. }
  40. }