Package org.apache.xpath.operations

Examples of org.apache.xpath.operations.Variable


   * @throws TransformerException if a error occurs creating the Expression.
   */
  protected Expression variable(int opPos) throws TransformerException
  {

    Variable var = new Variable();

    opPos = getFirstChildPos(opPos);

    int nsPos = getOp(opPos);
    java.lang.String namespace
      = (OpCodes.EMPTY == nsPos) ? null
                                   : (java.lang.String) getTokenQueue().elementAt(nsPos);
    java.lang.String localname
      = (java.lang.String) getTokenQueue().elementAt(getOp(opPos+1));
    QName qname = new QName(namespace, localname);

    var.setQName(qname);

    return var;
  }
View Full Code Here


   * @throws TransformerException if a error occurs creating the Expression.
   */
  protected Expression variable(int opPos) throws TransformerException
  {

    Variable var = new Variable();

    opPos = getFirstChildPos(opPos);

    int nsPos = getOp(opPos);
    java.lang.String namespace
      = (OpCodes.EMPTY == nsPos) ? null
                                   : (java.lang.String) getTokenQueue().elementAt(nsPos);
    java.lang.String localname
      = (java.lang.String) getTokenQueue().elementAt(getOp(opPos+1));
    QName qname = new QName(namespace, localname);

    var.setQName(qname);

    return var;
  }
View Full Code Here

   * @param isGlobal true if this will be a global reference.
   */
  protected LocPathIterator changePartToRef(final QName uniquePseudoVarName, WalkingIterator wi,
                                 final int numSteps, final boolean isGlobal)
  {
    Variable var = new Variable();
    var.setQName(uniquePseudoVarName);
    var.setIsGlobal(isGlobal);
    if(isGlobal)
    {  ElemTemplateElement elem = getElemFromExpression(wi);
      StylesheetRoot root = elem.getStylesheetRoot();
      Vector vars = root.getVariablesAndParamsComposed();
      var.setIndex(vars.size()-1);
    }
   
    // Walk to the first walker after the one's we are replacing.
    AxesWalker walker = wi.getFirstWalker();
    for(int i = 0; i < numSteps; i++)
View Full Code Here

   *                           being inserted, possibly a StylesheetRoot.
   */
  protected void changeToVarRef(QName varName, ExpressionOwner owner,
                                Vector paths, ElemTemplateElement psuedoVarRecipient)
  {
  Variable varRef = (paths == m_absPaths) ? new VariableSafeAbsRef() : new Variable();
  varRef.setQName(varName);
  if(paths == m_absPaths)
  {
    StylesheetRoot root = (StylesheetRoot)psuedoVarRecipient;
    Vector globalVars = root.getVariablesAndParamsComposed();
    // Assume this operation is occuring just after the decl has
    // been added.
    varRef.setIndex(globalVars.size()-1);
    varRef.setIsGlobal(true);
  }
  owner.setExpression(varRef);
  }
View Full Code Here

   * @throws TransformerException if a error occurs creating the Expression.
   */
  protected Expression variable(int opPos) throws TransformerException
  {

    Variable var = new Variable();

    opPos = getFirstChildPos(opPos);

    int nsPos = getOp(opPos);
    java.lang.String namespace
      = (OpCodes.EMPTY == nsPos) ? null
                                   : (java.lang.String) getTokenQueue().elementAt(nsPos);
    java.lang.String localname
      = (java.lang.String) getTokenQueue().elementAt(getOp(opPos+1));
    QName qname = new QName(namespace, localname);

    var.setQName(qname);

    return var;
  }
View Full Code Here

   * @throws TransformerException if a error occurs creating the Expression.
   */
  protected Expression variable(int opPos) throws TransformerException
  {

    Variable var = new Variable();

    opPos = getFirstChildPos(opPos);

    int nsPos = getOp(opPos);
    java.lang.String namespace
      = (OpCodes.EMPTY == nsPos) ? null
                                   : (java.lang.String) getTokenQueue().elementAt(nsPos);
    java.lang.String localname
      = (java.lang.String) getTokenQueue().elementAt(getOp(opPos+1));
    QName qname = new QName(namespace, localname);

    var.setQName(qname);

    return var;
  }
View Full Code Here

   * @param isGlobal true if this will be a global reference.
   */
  protected LocPathIterator changePartToRef(final QName uniquePseudoVarName, WalkingIterator wi,
                                 final int numSteps, final boolean isGlobal)
  {
    Variable var = new Variable();
    var.setQName(uniquePseudoVarName);
    var.setIsGlobal(isGlobal);
    if(isGlobal)
    {  ElemTemplateElement elem = getElemFromExpression(wi);
      StylesheetRoot root = elem.getStylesheetRoot();
      Vector vars = root.getVariablesAndParamsComposed();
      var.setIndex(vars.size()-1);
    }
   
    // Walk to the first walker after the one's we are replacing.
    AxesWalker walker = wi.getFirstWalker();
    for(int i = 0; i < numSteps; i++)
View Full Code Here

   *                           being inserted, possibly a StylesheetRoot.
   */
  protected void changeToVarRef(QName varName, ExpressionOwner owner,
                                Vector paths, ElemTemplateElement psuedoVarRecipient)
  {
  Variable varRef = (paths == m_absPaths) ? new VariableSafeAbsRef() : new Variable();
  varRef.setQName(varName);
  if(paths == m_absPaths)
  {
    StylesheetRoot root = (StylesheetRoot)psuedoVarRecipient;
    Vector globalVars = root.getVariablesAndParamsComposed();
    // Assume this operation is occuring just after the decl has
    // been added.
    varRef.setIndex(globalVars.size()-1);
    varRef.setIsGlobal(true);
  }
  owner.setExpression(varRef);
  }
View Full Code Here

   * @throws TransformerException if a error occurs creating the Expression.
   */
  protected Expression variable(int opPos) throws TransformerException
  {

    Variable var = new Variable();

    opPos = getFirstChildPos(opPos);

    int nsPos = getOp(opPos);
    java.lang.String namespace
      = (OpCodes.EMPTY == nsPos) ? null
                                   : (java.lang.String) getTokenQueue().elementAt(nsPos);
    java.lang.String localname
      = (java.lang.String) getTokenQueue().elementAt(getOp(opPos+1));
    QName qname = new QName(namespace, localname);

    var.setQName(qname);

    return var;
  }
View Full Code Here

   * @param isGlobal true if this will be a global reference.
   */
  protected LocPathIterator changePartToRef(final QName uniquePsuedoVarName, WalkingIterator wi,
                                 final int numSteps, final boolean isGlobal)
  {
    Variable var = new Variable();
    var.setQName(uniquePsuedoVarName);
    var.setIsGlobal(isGlobal);
    if(isGlobal)
    {  ElemTemplateElement elem = getElemFromExpression(wi);
      StylesheetRoot root = elem.getStylesheetRoot();
      Vector vars = root.getVariablesAndParamsComposed();
      var.setIndex(vars.size()-1);
    }
   
    // Walk to the first walker after the one's we are replacing.
    AxesWalker walker = wi.getFirstWalker();
    for(int i = 0; i < numSteps; i++)
View Full Code Here

TOP

Related Classes of org.apache.xpath.operations.Variable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.