ilene       2003/01/29 16:45:42

  Modified:    java/xpath_rwapi/src/org/apache/xpath/rwapi/impl Tag: xslt20
                        EvaluatorFactoryImpl.java CastExprImpl.java
                        NameTestImpl.java PathExprImpl.java
                        FunctionCallImpl.java ForAndQuantifiedExprImpl.java
                        KindTestImpl.java ExprContextImpl.java
                        LiteralImpl.java StepExprImpl.java
                        ExpressionFactoryImpl.java InstanceOfExprImpl.java
                        VariableImpl.java XPathFactoryImpl.java
                        CastableExprImpl.java ExprImpl.java
                        OperatorImpl.java ConditionalExprImpl.java
               java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/xalan Tag:
                        xslt20 EvaluatorImpl.java XObjectToSequence.java
               java/xpath_rwapi/src/org/apache/xpath/rwapi/expression Tag:
                        xslt20 StepExpr.java NodeTest.java
                        ExpressionFactory.java ExprContext.java
                        InstanceOfExpr.java OperatorExpr.java
                        Visitable.java Expr.java FunctionCall.java
                        CastExpr.java Literal.java PathExpr.java
                        Variable.java ConditionalExpr.java Visitor.java
                        ForAndQuantifiedExpr.java CastableExpr.java
                        StaticContext.java
               java/xpath_rwapi/src/org/apache/xpath/rwapi/datamodel Tag:
                        xslt20 Sequence.java SingleType.java Node.java
                        Item.java SequenceType.java ItemFactory.java
                        AtomicValue.java
               java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/parser Tag:
                        xslt20 XPath2Node.java Singletons.java Axis.java
                        KindTest.java Predicates.java QName.java
                        XPathNode.java
               java/xpath_rwapi/src/org/apache/xpath/rwapi Tag: xslt20
                        XPathException.java XPathFactory.java
               java/xpath_rwapi/src/org/apache/xpath/rwapi/eval Tag: xslt20
                        Evaluator.java NamespaceContext.java
                        EvaluatorFactory.java DynamicContext.java
               java/xpath_rwapi/src/org/apache/xpath/rwapi/test Tag: xslt20
                        Test.java Test2.java
  Log:
  Patch from Sarah McNamara ([EMAIL PROTECTED]) to update
  copyright statements.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.2   +1 -1      
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/EvaluatorFactoryImpl.java
  
  Index: EvaluatorFactoryImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/EvaluatorFactoryImpl.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- EvaluatorFactoryImpl.java 13 Dec 2002 21:50:44 -0000      1.1.2.1
  +++ EvaluatorFactoryImpl.java 30 Jan 2003 00:45:36 -0000      1.1.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  
  1.1.2.2   +1 -1      
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/CastExprImpl.java
  
  Index: CastExprImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/CastExprImpl.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- CastExprImpl.java 13 Dec 2002 21:50:44 -0000      1.1.2.1
  +++ CastExprImpl.java 30 Jan 2003 00:45:36 -0000      1.1.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  
  1.1.2.2   +1 -1      
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/NameTestImpl.java
  
  Index: NameTestImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/NameTestImpl.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- NameTestImpl.java 13 Dec 2002 21:50:44 -0000      1.1.2.1
  +++ NameTestImpl.java 30 Jan 2003 00:45:36 -0000      1.1.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  
  1.1.2.3   +194 -194  
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/PathExprImpl.java
  
  Index: PathExprImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/PathExprImpl.java,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- PathExprImpl.java 23 Jan 2003 19:36:49 -0000      1.1.2.2
  +++ PathExprImpl.java 30 Jan 2003 00:45:36 -0000      1.1.2.3
  @@ -1,194 +1,194 @@
  -/*
  - * The Apache Software License, Version 1.1
  - *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights
  - * reserved.
  - *
  - * Redistribution and use in source and binary forms, with or without
  - * modification, are permitted provided that the following conditions
  - * are met:
  - *
  - * 1. Redistributions of source code must retain the above copyright
  - *    notice, this list of conditions and the following disclaimer.
  - *
  - * 2. Redistributions in binary form must reproduce the above copyright
  - *    notice, this list of conditions and the following disclaimer in
  - *    the documentation and/or other materials provided with the
  - *    distribution.
  - *
  - * 3. The end-user documentation included with the redistribution,
  - *    if any, must include the following acknowledgment:
  - *       "This product includes software developed by the
  - *        Apache Software Foundation (http://www.apache.org/)."
  - *    Alternately, this acknowledgment may appear in the software itself,
  - *    if and wherever such third-party acknowledgments normally appear.
  - *
  - * 4. The names "Xalan" and "Apache Software Foundation" must
  - *    not be used to endorse or promote products derived from this
  - *    software without prior written permission. For written
  - *    permission, please contact [EMAIL PROTECTED]
  - *
  - * 5. Products derived from this software may not be called "Apache",
  - *    nor may "Apache" appear in their name, without prior written
  - *    permission of the Apache Software Foundation.
  - *
  - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  - * SUCH DAMAGE.
  - * ====================================================================
  - *
  - * This software consists of voluntary contributions made by many
  - * individuals on behalf of the Apache Software Foundation and was
  - * originally based on software copyright (c) 1999, Lotus
  - * Development Corporation., http://www.lotus.com.  For more
  - * information on the Apache Software Foundation, please see
  - * <http://www.apache.org/>.
  - */
  -package org.apache.xpath.rwapi.impl;
  -
  -import org.apache.xpath.rwapi.expression.Expr;
  -import org.apache.xpath.rwapi.expression.PathExpr;
  -import org.apache.xpath.rwapi.expression.StepExpr;
  -import org.apache.xpath.rwapi.expression.Visitor;
  -import org.apache.xpath.rwapi.impl.parser.Node;
  -import org.apache.xpath.rwapi.impl.parser.SimpleNode;
  -import org.apache.xpath.rwapi.impl.parser.Singletons;
  -import org.apache.xpath.rwapi.impl.parser.XPath;
  -import org.apache.xpath.rwapi.impl.parser.XPathTreeConstants;
  -
  -
  -/**
  - *
  - */
  -public class PathExprImpl extends OperatorImpl implements PathExpr
  -{
  -    boolean m_isAbsolute;
  -
  -    /**
  -     * Constructor for PathExprImpl.
  -     */
  -    protected PathExprImpl()
  -    {
  -        this(XPathTreeConstants.JJTPATHEXPR);
  -    }
  -
  -    /**
  -     * Constructor for PathExprImpl.
  -     * @param i
  -     */
  -    public PathExprImpl(int i)
  -    {
  -        super(i);
  -
  -        m_isAbsolute = false;
  -    }
  -
  -    /**
  -     * Constructor for PathExprImpl.
  -     * @param p
  -     * @param i
  -     */
  -    public PathExprImpl(XPath p, int i)
  -    {
  -        super(p, i);
  -
  -        m_isAbsolute = false;
  -    }
  -
  -    /**
  -     * @see org.apache.xpath.rwapi.expression.PathExpr#isAbsolute()
  -     */
  -    public boolean isAbsolute()
  -    {
  -        return m_isAbsolute;
  -    }
  -
  -    /**
  -      * @see org.apache.xpath.rwapi.expression.Visitable#visit(Visitor)
  -      */
  -    public void visit(Visitor visitor)
  -    {
  -        visitor.visitPath(this);
  -
  -        // visit each step (operand)
  -        super.visit(visitor);
  -    }
  -
  -    /**
  -              * @see 
org.apache.xpath.rwapi.impl.ExprImpl#getString(StringBuffer, boolean)
  -      */
  -    protected void getString(StringBuffer expr, boolean abbreviate)
  -    {
  -        if (m_isAbsolute)
  -        {
  -            expr.append("/");
  -        }
  -
  -        super.getString(expr, abbreviate);
  -    }
  -
  -    /**
  -     * @see org.apache.xpath.rwapi.impl.parser.Node#jjtAddChild(Node, int)
  -     */
  -    public void jjtAddChild(Node n, int i)
  -    {
  -        if (n.getId() == XPathTreeConstants.JJTROOT)
  -        {
  -            m_isAbsolute = true;
  -        }
  -        else if (n.getId() == XPathTreeConstants.JJTROOTDESCENDANTS)
  -        {
  -            m_isAbsolute = true;
  -            super.jjtAddChild(Singletons.SLASHSLASH, i);
  -        }
  -      //  else if (n.getId() == XPathTreeConstants.JJTSLASHSLASH)
  -       // {
  -            // expand to /descendant-or-self::node()/
  -       //     super.jjtAddChild(Singletons.SLASHSLASH, i);
  -        //}
  -        else if (n.getId() == XPathTreeConstants.JJTSLASH)
  -        {
  -            // filtered
  -        }
  -        else
  -        {
  -            if (((SimpleNode) n).canBeReduced())
  -            {
  -                super.jjtInsertChild(n.jjtGetChild(0));
  -            }
  -            else
  -            {
  -                super.jjtInsertChild(n);
  -            }
  -        }
  -    }
  -
  -    /**
  -     * @see org.apache.xpath.rwapi.impl.parser.SimpleNode#canBeReduced()
  -     */
  -    public boolean canBeReduced()
  -    {
  -        // Can be reduced whenever there is only one step and this step is a 
primary expression
  -        if ((children != null) && (children.length == 1))
  -        {
  -            Expr step = (Expr) children[0];
  -            int et = step.getExprType();
  -
  -            return (((et == STEP) && ((StepExpr) step).isPrimaryExpr())
  -                   || (et == LITERAL_EXPR) || (et == FUNCTION_CALL_EXPR)
  -                   || (et == SEQUENCE_EXPR) || (et == VARIABLE_REF_EXPR)
  -                   || (et == ARITHMETIC_EXPR));
  -        }
  -
  -        return false;
  -    }
  -}
  +/*
  + * The Apache Software License, Version 1.1
  + *
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights
  + * reserved.
  + *
  + * Redistribution and use in source and binary forms, with or without
  + * modification, are permitted provided that the following conditions
  + * are met:
  + *
  + * 1. Redistributions of source code must retain the above copyright
  + *    notice, this list of conditions and the following disclaimer.
  + *
  + * 2. Redistributions in binary form must reproduce the above copyright
  + *    notice, this list of conditions and the following disclaimer in
  + *    the documentation and/or other materials provided with the
  + *    distribution.
  + *
  + * 3. The end-user documentation included with the redistribution,
  + *    if any, must include the following acknowledgment:
  + *       "This product includes software developed by the
  + *        Apache Software Foundation (http://www.apache.org/)."
  + *    Alternately, this acknowledgment may appear in the software itself,
  + *    if and wherever such third-party acknowledgments normally appear.
  + *
  + * 4. The names "Xalan" and "Apache Software Foundation" must
  + *    not be used to endorse or promote products derived from this
  + *    software without prior written permission. For written
  + *    permission, please contact [EMAIL PROTECTED]
  + *
  + * 5. Products derived from this software may not be called "Apache",
  + *    nor may "Apache" appear in their name, without prior written
  + *    permission of the Apache Software Foundation.
  + *
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  + * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  + * SUCH DAMAGE.
  + * ====================================================================
  + *
  + * This software consists of voluntary contributions made by many
  + * individuals on behalf of the Apache Software Foundation and was
  + * originally based on software copyright (c) 1999, Lotus
  + * Development Corporation., http://www.lotus.com.  For more
  + * information on the Apache Software Foundation, please see
  + * <http://www.apache.org/>.
  + */
  +package org.apache.xpath.rwapi.impl;
  +
  +import org.apache.xpath.rwapi.expression.Expr;
  +import org.apache.xpath.rwapi.expression.PathExpr;
  +import org.apache.xpath.rwapi.expression.StepExpr;
  +import org.apache.xpath.rwapi.expression.Visitor;
  +import org.apache.xpath.rwapi.impl.parser.Node;
  +import org.apache.xpath.rwapi.impl.parser.SimpleNode;
  +import org.apache.xpath.rwapi.impl.parser.Singletons;
  +import org.apache.xpath.rwapi.impl.parser.XPath;
  +import org.apache.xpath.rwapi.impl.parser.XPathTreeConstants;
  +
  +
  +/**
  + *
  + */
  +public class PathExprImpl extends OperatorImpl implements PathExpr
  +{
  +    boolean m_isAbsolute;
  +
  +    /**
  +     * Constructor for PathExprImpl.
  +     */
  +    protected PathExprImpl()
  +    {
  +        this(XPathTreeConstants.JJTPATHEXPR);
  +    }
  +
  +    /**
  +     * Constructor for PathExprImpl.
  +     * @param i
  +     */
  +    public PathExprImpl(int i)
  +    {
  +        super(i);
  +
  +        m_isAbsolute = false;
  +    }
  +
  +    /**
  +     * Constructor for PathExprImpl.
  +     * @param p
  +     * @param i
  +     */
  +    public PathExprImpl(XPath p, int i)
  +    {
  +        super(p, i);
  +
  +        m_isAbsolute = false;
  +    }
  +
  +    /**
  +     * @see org.apache.xpath.rwapi.expression.PathExpr#isAbsolute()
  +     */
  +    public boolean isAbsolute()
  +    {
  +        return m_isAbsolute;
  +    }
  +
  +    /**
  +      * @see org.apache.xpath.rwapi.expression.Visitable#visit(Visitor)
  +      */
  +    public void visit(Visitor visitor)
  +    {
  +        visitor.visitPath(this);
  +
  +        // visit each step (operand)
  +        super.visit(visitor);
  +    }
  +
  +    /**
  +              * @see 
org.apache.xpath.rwapi.impl.ExprImpl#getString(StringBuffer, boolean)
  +      */
  +    protected void getString(StringBuffer expr, boolean abbreviate)
  +    {
  +        if (m_isAbsolute)
  +        {
  +            expr.append("/");
  +        }
  +
  +        super.getString(expr, abbreviate);
  +    }
  +
  +    /**
  +     * @see org.apache.xpath.rwapi.impl.parser.Node#jjtAddChild(Node, int)
  +     */
  +    public void jjtAddChild(Node n, int i)
  +    {
  +        if (n.getId() == XPathTreeConstants.JJTROOT)
  +        {
  +            m_isAbsolute = true;
  +        }
  +        else if (n.getId() == XPathTreeConstants.JJTROOTDESCENDANTS)
  +        {
  +            m_isAbsolute = true;
  +            super.jjtAddChild(Singletons.SLASHSLASH, i);
  +        }
  +      //  else if (n.getId() == XPathTreeConstants.JJTSLASHSLASH)
  +       // {
  +            // expand to /descendant-or-self::node()/
  +       //     super.jjtAddChild(Singletons.SLASHSLASH, i);
  +        //}
  +        else if (n.getId() == XPathTreeConstants.JJTSLASH)
  +        {
  +            // filtered
  +        }
  +        else
  +        {
  +            if (((SimpleNode) n).canBeReduced())
  +            {
  +                super.jjtInsertChild(n.jjtGetChild(0));
  +            }
  +            else
  +            {
  +                super.jjtInsertChild(n);
  +            }
  +        }
  +    }
  +
  +    /**
  +     * @see org.apache.xpath.rwapi.impl.parser.SimpleNode#canBeReduced()
  +     */
  +    public boolean canBeReduced()
  +    {
  +        // Can be reduced whenever there is only one step and this step is a 
primary expression
  +        if ((children != null) && (children.length == 1))
  +        {
  +            Expr step = (Expr) children[0];
  +            int et = step.getExprType();
  +
  +            return (((et == STEP) && ((StepExpr) step).isPrimaryExpr())
  +                   || (et == LITERAL_EXPR) || (et == FUNCTION_CALL_EXPR)
  +                   || (et == SEQUENCE_EXPR) || (et == VARIABLE_REF_EXPR)
  +                   || (et == ARITHMETIC_EXPR));
  +        }
  +
  +        return false;
  +    }
  +}
  
  
  
  1.1.2.2   +1 -1      
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/FunctionCallImpl.java
  
  Index: FunctionCallImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/FunctionCallImpl.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- FunctionCallImpl.java     13 Dec 2002 21:50:44 -0000      1.1.2.1
  +++ FunctionCallImpl.java     30 Jan 2003 00:45:36 -0000      1.1.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  
  1.1.2.2   +1 -1      
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/ForAndQuantifiedExprImpl.java
  
  Index: ForAndQuantifiedExprImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/ForAndQuantifiedExprImpl.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- ForAndQuantifiedExprImpl.java     13 Dec 2002 21:50:44 -0000      1.1.2.1
  +++ ForAndQuantifiedExprImpl.java     30 Jan 2003 00:45:36 -0000      1.1.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  
  1.1.2.2   +1 -1      
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/KindTestImpl.java
  
  Index: KindTestImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/KindTestImpl.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- KindTestImpl.java 13 Dec 2002 21:50:44 -0000      1.1.2.1
  +++ KindTestImpl.java 30 Jan 2003 00:45:36 -0000      1.1.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  
  1.1.2.2   +1 -1      
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/ExprContextImpl.java
  
  Index: ExprContextImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/ExprContextImpl.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- ExprContextImpl.java      13 Dec 2002 21:50:44 -0000      1.1.2.1
  +++ ExprContextImpl.java      30 Jan 2003 00:45:36 -0000      1.1.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  
  1.1.2.3   +298 -298  
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/LiteralImpl.java
  
  Index: LiteralImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/LiteralImpl.java,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- LiteralImpl.java  23 Jan 2003 19:36:49 -0000      1.1.2.2
  +++ LiteralImpl.java  30 Jan 2003 00:45:36 -0000      1.1.2.3
  @@ -1,298 +1,298 @@
  -/*
  - * The Apache Software License, Version 1.1
  - *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights
  - * reserved.
  - *
  - * Redistribution and use in source and binary forms, with or without
  - * modification, are permitted provided that the following conditions
  - * are met:
  - *
  - * 1. Redistributions of source code must retain the above copyright
  - *    notice, this list of conditions and the following disclaimer.
  - *
  - * 2. Redistributions in binary form must reproduce the above copyright
  - *    notice, this list of conditions and the following disclaimer in
  - *    the documentation and/or other materials provided with the
  - *    distribution.
  - *
  - * 3. The end-user documentation included with the redistribution,
  - *    if any, must include the following acknowledgment:
  - *       "This product includes software developed by the
  - *        Apache Software Foundation (http://www.apache.org/)."
  - *    Alternately, this acknowledgment may appear in the software itself,
  - *    if and wherever such third-party acknowledgments normally appear.
  - *
  - * 4. The names "Xalan" and "Apache Software Foundation" must
  - *    not be used to endorse or promote products derived from this
  - *    software without prior written permission. For written
  - *    permission, please contact [EMAIL PROTECTED]
  - *
  - * 5. Products derived from this software may not be called "Apache",
  - *    nor may "Apache" appear in their name, without prior written
  - *    permission of the Apache Software Foundation.
  - *
  - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  - * SUCH DAMAGE.
  - * ====================================================================
  - *
  - * This software consists of voluntary contributions made by many
  - * individuals on behalf of the Apache Software Foundation and was
  - * originally based on software copyright (c) 1999, Lotus
  - * Development Corporation., http://www.lotus.com.  For more
  - * information on the Apache Software Foundation, please see
  - * <http://www.apache.org/>.
  - */
  -package org.apache.xpath.rwapi.impl;
  -
  -import org.apache.xpath.rwapi.XPathException;
  -import org.apache.xpath.rwapi.expression.Expr;
  -import org.apache.xpath.rwapi.expression.Literal;
  -import org.apache.xpath.rwapi.expression.Visitor;
  -import org.apache.xpath.rwapi.impl.parser.Token;
  -import org.apache.xpath.rwapi.impl.parser.XPath;
  -import org.apache.xpath.rwapi.impl.parser.XPathTreeConstants;
  -
  -
  -/**
  - *
  - */
  -public class LiteralImpl extends ExprImpl implements Literal
  -{
  -    Object m_literal;
  -
  -    /**
  -     *
  -     *
  -     */
  -    protected LiteralImpl()
  -    {
  -        super();
  -    }
  -
  -    /**
  -     * Constructor for PrimaryExprImpl.
  -     * @param i
  -     */
  -    public LiteralImpl(int i)
  -    {
  -        super(i);
  -    }
  -
  -    /**
  -     * Constructor for PrimaryExprImpl.
  -     * @param p
  -     * @param i
  -     */
  -    public LiteralImpl(XPath p, int i)
  -    {
  -        super(p, i);
  -    }
  -
  -    /**
  -     * @see org.apache.xpath.rwapi.expression.Expr#getExprType()
  -     */
  -    public short getExprType()
  -    {
  -        return Expr.LITERAL_EXPR;
  -    }
  -
  -    /**
  -     * @see org.apache.xpath.rwapi.expression.Expr#cloneExpression()
  -     */
  -    public Expr cloneExpression()
  -    {
  -        return null;
  -    }
  -
  -    /**
  -     * @see org.apache.xpath.rwapi.expression.Literal#getDecimalLiteral()
  -     */
  -    public float getDecimalLiteral() throws XPathException
  -    {
  -        if (getLiteralType() == DECIMAL_LITERAL)
  -        {
  -            return ((Float) m_literal).floatValue();
  -        }
  -
  -        throw new XPathException(
  -            "Invalid method call: the literal is not a decimal");
  -    }
  -
  -    /**
  -     * @see org.apache.xpath.rwapi.expression.Literal#getDoubleLiteral()
  -     */
  -    public double getDoubleLiteral() throws XPathException
  -    {
  -        if (getLiteralType() == DOUBLE_LITERAL)
  -        {
  -            return ((Double) m_literal).doubleValue();
  -        }
  -
  -        throw new XPathException(
  -            "Invalid method call: the literal is not a double");
  -    }
  -
  -    /**
  -     * @see org.apache.xpath.rwapi.expression.Literal#getIntegerLiteral()
  -     */
  -    public int getIntegerLiteral() throws XPathException
  -    {
  -        if (getLiteralType() == INTEGER_LITERAL)
  -        {
  -            return ((Integer) m_literal).intValue();
  -        }
  -
  -        throw new XPathException(
  -            "Invalid method call: the literal is not a integer");
  -    }
  -
  -    /**
  -     * @see org.apache.xpath.rwapi.expression.Literal#getLiteralType()
  -     */
  -    public short getLiteralType()
  -    {
  -        switch (id)
  -        {
  -            case XPathTreeConstants.JJTINTEGERLITERAL:
  -                return INTEGER_LITERAL;
  -
  -            //break;
  -            case XPathTreeConstants.JJTDOUBLELITERAL:
  -                return DOUBLE_LITERAL;
  -
  -            //break;
  -            case XPathTreeConstants.JJTSTRINGLITERAL:
  -                return STRING_LITERAL;
  -
  -            //break;
  -            case XPathTreeConstants.JJTDECIMALLITERAL:
  -                return DECIMAL_LITERAL;
  -
  -            //break;
  -            default:
  -
  -                // bug
  -                throw new RuntimeException("Invalid JJTree id:" + id);
  -        }
  -    }
  -
  -    /**
  -     * @see org.apache.xpath.rwapi.expression.Literal#getStringLiteral()
  -     */
  -    public String getStringLiteral() throws XPathException
  -    {
  -        if (getLiteralType() == STRING_LITERAL)
  -        {
  -            return (String) m_literal;
  -        }
  -
  -        throw new XPathException(
  -            "Invalid method call: the literal is not a string");
  -    }
  -
  -    /**
  -     * @see org.apache.xpath.rwapi.expression.Expr#getString(boolean)
  -     */
  -    public String getString(boolean abbreviate)
  -    {
  -        return m_literal.toString();
  -    }
  -
  -    /**
  -     * @see org.apache.xpath.rwapi.expression.Visitable#visited(Visitor)
  -     */
  -    public void visited(Visitor visitor) {}
  -
  -    /**
  -     * @see org.apache.xpath.rwapi.impl.parser.SimpleNode#processToken(Token)
  -     */
  -    public void processToken(Token token)
  -    {
  -        super.processToken(token);
  -
  -        switch (id)
  -        {
  -            case XPathTreeConstants.JJTINTEGERLITERAL:
  -                m_literal = new Integer(token.image);
  -
  -                break;
  -
  -            case XPathTreeConstants.JJTDOUBLELITERAL:
  -                m_literal = new Double(token.image);
  -
  -            //break;
  -            case XPathTreeConstants.JJTSTRINGLITERAL:
  -                m_literal = token.image;
  -
  -                break;
  -
  -            case XPathTreeConstants.JJTDECIMALLITERAL:
  -                m_literal = new Float(token.image);
  -
  -                break;
  -
  -            default:
  -
  -                // bug
  -                throw new RuntimeException("Invalid JJTree id:" + id);
  -        }
  -    }
  -
  -    /**
  -     * @see org.apache.xpath.rwapi.impl.ExprImpl#getString(StringBuffer, 
boolean)
  -     */
  -    protected void getString(StringBuffer expr, boolean abbreviate)
  -    {
  -        expr.append(m_literal.toString());
  -    }
  -
  -    /**
  -     * @param value
  -     */
  -    protected void setIntValue(int value)
  -    {
  -        m_literal = new Integer(value);
  -        id = XPathTreeConstants.JJTINTEGERLITERAL;
  -    }
  -
  -    /**
  -     *
  -     * @param value
  -     */
  -    protected void setDecimalValue(float value)
  -    {
  -        m_literal = new Float(value);
  -        id = XPathTreeConstants.JJTDECIMALLITERAL;
  -    }
  -
  -    /**
  -     *
  -     * @param value
  -     */
  -    protected void setStringValue(String value)
  -    {
  -        m_literal = value;
  -        id = XPathTreeConstants.JJTSTRINGLITERAL;
  -    }
  -
  -    /**
  -     *
  -     * @param value
  -     */
  -    protected void setDoubleValue(double value)
  -    {
  -        m_literal = new Double(value);
  -        id = XPathTreeConstants.JJTDOUBLELITERAL;
  -    }
  -}
  +/*
  + * The Apache Software License, Version 1.1
  + *
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights
  + * reserved.
  + *
  + * Redistribution and use in source and binary forms, with or without
  + * modification, are permitted provided that the following conditions
  + * are met:
  + *
  + * 1. Redistributions of source code must retain the above copyright
  + *    notice, this list of conditions and the following disclaimer.
  + *
  + * 2. Redistributions in binary form must reproduce the above copyright
  + *    notice, this list of conditions and the following disclaimer in
  + *    the documentation and/or other materials provided with the
  + *    distribution.
  + *
  + * 3. The end-user documentation included with the redistribution,
  + *    if any, must include the following acknowledgment:
  + *       "This product includes software developed by the
  + *        Apache Software Foundation (http://www.apache.org/)."
  + *    Alternately, this acknowledgment may appear in the software itself,
  + *    if and wherever such third-party acknowledgments normally appear.
  + *
  + * 4. The names "Xalan" and "Apache Software Foundation" must
  + *    not be used to endorse or promote products derived from this
  + *    software without prior written permission. For written
  + *    permission, please contact [EMAIL PROTECTED]
  + *
  + * 5. Products derived from this software may not be called "Apache",
  + *    nor may "Apache" appear in their name, without prior written
  + *    permission of the Apache Software Foundation.
  + *
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  + * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  + * SUCH DAMAGE.
  + * ====================================================================
  + *
  + * This software consists of voluntary contributions made by many
  + * individuals on behalf of the Apache Software Foundation and was
  + * originally based on software copyright (c) 1999, Lotus
  + * Development Corporation., http://www.lotus.com.  For more
  + * information on the Apache Software Foundation, please see
  + * <http://www.apache.org/>.
  + */
  +package org.apache.xpath.rwapi.impl;
  +
  +import org.apache.xpath.rwapi.XPathException;
  +import org.apache.xpath.rwapi.expression.Expr;
  +import org.apache.xpath.rwapi.expression.Literal;
  +import org.apache.xpath.rwapi.expression.Visitor;
  +import org.apache.xpath.rwapi.impl.parser.Token;
  +import org.apache.xpath.rwapi.impl.parser.XPath;
  +import org.apache.xpath.rwapi.impl.parser.XPathTreeConstants;
  +
  +
  +/**
  + *
  + */
  +public class LiteralImpl extends ExprImpl implements Literal
  +{
  +    Object m_literal;
  +
  +    /**
  +     *
  +     *
  +     */
  +    protected LiteralImpl()
  +    {
  +        super();
  +    }
  +
  +    /**
  +     * Constructor for PrimaryExprImpl.
  +     * @param i
  +     */
  +    public LiteralImpl(int i)
  +    {
  +        super(i);
  +    }
  +
  +    /**
  +     * Constructor for PrimaryExprImpl.
  +     * @param p
  +     * @param i
  +     */
  +    public LiteralImpl(XPath p, int i)
  +    {
  +        super(p, i);
  +    }
  +
  +    /**
  +     * @see org.apache.xpath.rwapi.expression.Expr#getExprType()
  +     */
  +    public short getExprType()
  +    {
  +        return Expr.LITERAL_EXPR;
  +    }
  +
  +    /**
  +     * @see org.apache.xpath.rwapi.expression.Expr#cloneExpression()
  +     */
  +    public Expr cloneExpression()
  +    {
  +        return null;
  +    }
  +
  +    /**
  +     * @see org.apache.xpath.rwapi.expression.Literal#getDecimalLiteral()
  +     */
  +    public float getDecimalLiteral() throws XPathException
  +    {
  +        if (getLiteralType() == DECIMAL_LITERAL)
  +        {
  +            return ((Float) m_literal).floatValue();
  +        }
  +
  +        throw new XPathException(
  +            "Invalid method call: the literal is not a decimal");
  +    }
  +
  +    /**
  +     * @see org.apache.xpath.rwapi.expression.Literal#getDoubleLiteral()
  +     */
  +    public double getDoubleLiteral() throws XPathException
  +    {
  +        if (getLiteralType() == DOUBLE_LITERAL)
  +        {
  +            return ((Double) m_literal).doubleValue();
  +        }
  +
  +        throw new XPathException(
  +            "Invalid method call: the literal is not a double");
  +    }
  +
  +    /**
  +     * @see org.apache.xpath.rwapi.expression.Literal#getIntegerLiteral()
  +     */
  +    public int getIntegerLiteral() throws XPathException
  +    {
  +        if (getLiteralType() == INTEGER_LITERAL)
  +        {
  +            return ((Integer) m_literal).intValue();
  +        }
  +
  +        throw new XPathException(
  +            "Invalid method call: the literal is not a integer");
  +    }
  +
  +    /**
  +     * @see org.apache.xpath.rwapi.expression.Literal#getLiteralType()
  +     */
  +    public short getLiteralType()
  +    {
  +        switch (id)
  +        {
  +            case XPathTreeConstants.JJTINTEGERLITERAL:
  +                return INTEGER_LITERAL;
  +
  +            //break;
  +            case XPathTreeConstants.JJTDOUBLELITERAL:
  +                return DOUBLE_LITERAL;
  +
  +            //break;
  +            case XPathTreeConstants.JJTSTRINGLITERAL:
  +                return STRING_LITERAL;
  +
  +            //break;
  +            case XPathTreeConstants.JJTDECIMALLITERAL:
  +                return DECIMAL_LITERAL;
  +
  +            //break;
  +            default:
  +
  +                // bug
  +                throw new RuntimeException("Invalid JJTree id:" + id);
  +        }
  +    }
  +
  +    /**
  +     * @see org.apache.xpath.rwapi.expression.Literal#getStringLiteral()
  +     */
  +    public String getStringLiteral() throws XPathException
  +    {
  +        if (getLiteralType() == STRING_LITERAL)
  +        {
  +            return (String) m_literal;
  +        }
  +
  +        throw new XPathException(
  +            "Invalid method call: the literal is not a string");
  +    }
  +
  +    /**
  +     * @see org.apache.xpath.rwapi.expression.Expr#getString(boolean)
  +     */
  +    public String getString(boolean abbreviate)
  +    {
  +        return m_literal.toString();
  +    }
  +
  +    /**
  +     * @see org.apache.xpath.rwapi.expression.Visitable#visited(Visitor)
  +     */
  +    public void visited(Visitor visitor) {}
  +
  +    /**
  +     * @see org.apache.xpath.rwapi.impl.parser.SimpleNode#processToken(Token)
  +     */
  +    public void processToken(Token token)
  +    {
  +        super.processToken(token);
  +
  +        switch (id)
  +        {
  +            case XPathTreeConstants.JJTINTEGERLITERAL:
  +                m_literal = new Integer(token.image);
  +
  +                break;
  +
  +            case XPathTreeConstants.JJTDOUBLELITERAL:
  +                m_literal = new Double(token.image);
  +
  +            //break;
  +            case XPathTreeConstants.JJTSTRINGLITERAL:
  +                m_literal = token.image;
  +
  +                break;
  +
  +            case XPathTreeConstants.JJTDECIMALLITERAL:
  +                m_literal = new Float(token.image);
  +
  +                break;
  +
  +            default:
  +
  +                // bug
  +                throw new RuntimeException("Invalid JJTree id:" + id);
  +        }
  +    }
  +
  +    /**
  +     * @see org.apache.xpath.rwapi.impl.ExprImpl#getString(StringBuffer, 
boolean)
  +     */
  +    protected void getString(StringBuffer expr, boolean abbreviate)
  +    {
  +        expr.append(m_literal.toString());
  +    }
  +
  +    /**
  +     * @param value
  +     */
  +    protected void setIntValue(int value)
  +    {
  +        m_literal = new Integer(value);
  +        id = XPathTreeConstants.JJTINTEGERLITERAL;
  +    }
  +
  +    /**
  +     *
  +     * @param value
  +     */
  +    protected void setDecimalValue(float value)
  +    {
  +        m_literal = new Float(value);
  +        id = XPathTreeConstants.JJTDECIMALLITERAL;
  +    }
  +
  +    /**
  +     *
  +     * @param value
  +     */
  +    protected void setStringValue(String value)
  +    {
  +        m_literal = value;
  +        id = XPathTreeConstants.JJTSTRINGLITERAL;
  +    }
  +
  +    /**
  +     *
  +     * @param value
  +     */
  +    protected void setDoubleValue(double value)
  +    {
  +        m_literal = new Double(value);
  +        id = XPathTreeConstants.JJTDOUBLELITERAL;
  +    }
  +}
  
  
  
  1.1.2.3   +451 -451  
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/StepExprImpl.java
  
  Index: StepExprImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/StepExprImpl.java,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- StepExprImpl.java 23 Jan 2003 19:36:49 -0000      1.1.2.2
  +++ StepExprImpl.java 30 Jan 2003 00:45:36 -0000      1.1.2.3
  @@ -1,451 +1,451 @@
  -/*
  - * The Apache Software License, Version 1.1
  - *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights
  - * reserved.
  - *
  - * Redistribution and use in source and binary forms, with or without
  - * modification, are permitted provided that the following conditions
  - * are met:
  - *
  - * 1. Redistributions of source code must retain the above copyright
  - *    notice, this list of conditions and the following disclaimer.
  - *
  - * 2. Redistributions in binary form must reproduce the above copyright
  - *    notice, this list of conditions and the following disclaimer in
  - *    the documentation and/or other materials provided with the
  - *    distribution.
  - *
  - * 3. The end-user documentation included with the redistribution,
  - *    if any, must include the following acknowledgment:
  - *       "This product includes software developed by the
  - *        Apache Software Foundation (http://www.apache.org/)."
  - *    Alternately, this acknowledgment may appear in the software itself,
  - *    if and wherever such third-party acknowledgments normally appear.
  - *
  - * 4. The names "Xalan" and "Apache Software Foundation" must
  - *    not be used to endorse or promote products derived from this
  - *    software without prior written permission. For written
  - *    permission, please contact [EMAIL PROTECTED]
  - *
  - * 5. Products derived from this software may not be called "Apache",
  - *    nor may "Apache" appear in their name, without prior written
  - *    permission of the Apache Software Foundation.
  - *
  - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  - * SUCH DAMAGE.
  - * ====================================================================
  - *
  - * This software consists of voluntary contributions made by many
  - * individuals on behalf of the Apache Software Foundation and was
  - * originally based on software copyright (c) 1999, Lotus
  - * Development Corporation., http://www.lotus.com.  For more
  - * information on the Apache Software Foundation, please see
  - * <http://www.apache.org/>.
  - */
  -package org.apache.xpath.rwapi.impl;
  -
  -import org.apache.xpath.rwapi.XPathException;
  -import org.apache.xpath.rwapi.expression.Expr;
  -import org.apache.xpath.rwapi.expression.NodeTest;
  -import org.apache.xpath.rwapi.expression.StepExpr;
  -import org.apache.xpath.rwapi.expression.Visitor;
  -import org.apache.xpath.rwapi.impl.parser.Axis;
  -import org.apache.xpath.rwapi.impl.parser.Node;
  -import org.apache.xpath.rwapi.impl.parser.XPath;
  -import org.apache.xpath.rwapi.impl.parser.XPathTreeConstants;
  -
  -
  -/**
  - * Implementation of step expression
  - */
  -public class StepExprImpl extends ExprImpl implements StepExpr
  -{
  -    final static boolean[] AXIS_FORWARD = 
  -                                          {
  -                                              false, true, true, false, true,
  -                                              true, true, false, true, false,
  -                                              true, false, true, false
  -                                          };
  -
  -    /**
  -     * Axis type. -1 whenever this step expr is a primary expr
  -     */
  -    short m_axisType = -2;
  -
  -    /**
  -     * Constructor for StepExprImpl.
  -     * @param i
  -     */
  -    public StepExprImpl(int i)
  -    {
  -        super(i);
  -    }
  -
  -    /**
  -     * Constructor for StepExprImpl.
  -     * @param p
  -     * @param i
  -     */
  -    public StepExprImpl(XPath p, int i)
  -    {
  -        super(p, i);
  -    }
  -
  -    /**
  -     * Constructor for StepExprImpl.
  -     * @param axisType
  -     * @param NodeTest
  -     */
  -    public StepExprImpl(short axisType, NodeTest nodeTest)
  -    {
  -        super(XPathTreeConstants.JJTSTEPEXPR);
  -
  -        m_axisType = axisType;
  -        super.jjtAddChild((Node) nodeTest, 0);
  -
  -        //  super.jjtAddChild(new 
OperatorImpl(XPathTreeConstants.JJTPREDICATES), 1);
  -    }
  -
  -    /**
  -     * @see org.apache.xpath.rwapi.expression.StepExpr#getPredicateAt(int)
  -     */
  -    public Expr getPredicateAt(int i)
  -    {
  -        return (Expr) children[i + 1];
  -    }
  -
  -    /**
  -     * @see org.apache.xpath.rwapi.expression.StepExpr#getPredicateCount()
  -     */
  -    public int getPredicateCount()
  -    {
  -        return children.length - 1;
  -    }
  -
  -    /**
  -     * @see org.apache.xpath.rwapi.expression.StepExpr#appendPredicate(Expr)
  -     */
  -    public void appendPredicate(Expr predicate)
  -    {
  -        super.jjtAddChild((Node) predicate, children.length);
  -    }
  -
  -    /**
  -     * @see org.apache.xpath.rwapi.expression.StepExpr#removePredicate(Expr)
  -     */
  -    public void removePredicate(Expr predicate) {}
  -
  -    /**
  -     * @see org.apache.xpath.rwapi.expression.Visitable#visit(Visitor)
  -     */
  -    public void visit(Visitor visitor)
  -    {
  -        visitor.visitStep(this);
  -    }
  -
  -    /**
  -     * @see org.apache.xpath.rwapi.expression.StepExpr#isForwardStep()
  -     */
  -    public boolean isForwardStep()
  -    {
  -        return (m_axisType != -1) && AXIS_FORWARD[m_axisType];
  -    }
  -
  -    /**
  -     * @see org.apache.xpath.rwapi.expression.StepExpr#isReversedStep()
  -     */
  -    public boolean isReversedStep()
  -    {
  -        return (m_axisType != -1) && !AXIS_FORWARD[m_axisType];
  -    }
  -
  -    /**
  -     * @see org.apache.xpath.rwapi.expression.StepExpr#isPrimaryExpr()
  -     */
  -    public boolean isPrimaryExpr()
  -    {
  -        return m_axisType == -1;
  -    }
  -
  -    /**
  -     * @see org.apache.xpath.rwapi.expression.StepExpr#getAxisType()
  -     */
  -    public short getAxisType() throws XPathException
  -    {
  -        if (m_axisType == -1)
  -        {
  -            throw new XPathException("Invalid call of this method on primary 
expression");
  -        }
  -
  -        return m_axisType;
  -    }
  -
  -    /**
  -     * @see org.apache.xpath.rwapi.expression.StepExpr#setAxisType(short)
  -     */
  -    public void setAxisType(short newType) throws XPathException
  -    {
  -        if (m_axisType == -1)
  -        {
  -            throw new XPathException("Invalid call of this method on primary 
expression");
  -        }
  -
  -        m_axisType = newType;
  -    }
  -
  -    /**
  -     * @see org.apache.xpath.rwapi.expression.StepExpr#getAxisName()
  -     */
  -    public String getAxisName() throws XPathException
  -    {
  -        if (m_axisType == -1)
  -        {
  -            throw new XPathException("Invalid call of this method on primary 
expression");
  -        }
  -
  -        return StepExprImpl.FULL_AXIS_NAME[m_axisType];
  -    }
  -
  -    /**
  -     * @see org.apache.xpath.rwapi.expression.StepExpr#getStepNodeTest()
  -     */
  -    public NodeTest getStepNodeTest() throws XPathException
  -    {
  -        if (m_axisType == -1)
  -        {
  -            throw new XPathException("Invalid call of this method on step 
compose of primary expression");
  -        }
  -
  -        return (NodeTest) children[0];
  -    }
  -
  -    /**
  -     * @see org.apache.xpath.rwapi.expression.StepExpr#getPrimaryExpr()
  -     */
  -    public Expr getPrimaryExpr() throws XPathException
  -    {
  -        if (m_axisType != -1)
  -        {
  -            throw new XPathException("Invalid call of this method on step 
compose of node test");
  -        }
  -
  -        return (Expr) children[0];
  -    }
  -
  -    /**
  -     * @see org.apache.xpath.rwapi.expression.StepExpr#cloneStep()
  -     */
  -    public StepExpr cloneStep()
  -    {
  -        return null;
  -    }
  -
  -    /**
  -     * @see org.apache.xpath.rwapi.expression.Expr#getExprType()
  -     */
  -    public short getExprType()
  -    {
  -        return StepExprImpl.STEP;
  -    }
  -
  -    /**
  -     * @see org.apache.xpath.rwapi.expression.Expr#cloneExpression()
  -     */
  -    public Expr cloneExpression()
  -    {
  -        return null;
  -    }
  -
  -    /**
  -     * @see org.apache.xpath.rwapi.impl.parser.Node#jjtAddChild(Node, int)
  -     */
  -    public void jjtAddChild(Node n, int i)
  -    {
  -        switch (n.getId())
  -        {
  -            case XPathTreeConstants.JJTAT:
  -                m_axisType = AXIS_ATTRIBUTE;
  -
  -                break;
  -
  -            case XPathTreeConstants.JJTAXISCHILD:
  -            case XPathTreeConstants.JJTAXISDESCENDANT:
  -            case XPathTreeConstants.JJTAXISANCESTOR:
  -            case XPathTreeConstants.JJTAXISSELF:
  -            case XPathTreeConstants.JJTAXISDESCENDANTORSELF:
  -            case XPathTreeConstants.JJTAXISFOLLOWINGSIBLING:
  -            case XPathTreeConstants.JJTAXISFOLLOWING:
  -            case XPathTreeConstants.JJTAXISNAMESPACE:
  -            case XPathTreeConstants.JJTAXISPARENT:
  -            case XPathTreeConstants.JJTAXISPRECEDINGSIBLING:
  -            case XPathTreeConstants.JJTAXISPRECEDING:
  -            case XPathTreeConstants.JJTAXISANCESTORORSELF:
  -                m_axisType = ((Axis) n).getAxis();
  -
  -                break;
  -
  -            case XPathTreeConstants.JJTNAMETEST:
  -
  -                // At production
  -                super.jjtAddChild(n, 0);
  -
  -                break;
  -
  -            case XPathTreeConstants.JJTNODETEST:
  -
  -                if (m_axisType == -2)
  -                {
  -                    // NodeTest production
  -                    m_axisType = AXIS_CHILD;
  -                    super.jjtAddChild(n.jjtGetChild(0), 0);
  -                }
  -                else
  -                {
  -                    // reduce
  -                    super.jjtAddChild(n.jjtGetChild(0), 0);
  -                }
  -
  -                break;
  -
  -            case XPathTreeConstants.JJTDOTDOT:
  -                m_axisType = AXIS_PARENT;
  -
  -                KindTestImpl node = new KindTestImpl();
  -                node.m_kindTest = NodeTest.ANY_KIND_TEST;
  -                super.jjtAddChild(node, 0);
  -
  -                break;
  -
  -            case XPathTreeConstants.JJTDOT:
  -
  -                // TODO : need to extend XPath API?
  -                break;
  -
  -            case XPathTreeConstants.JJTINTEGERLITERAL:
  -            case XPathTreeConstants.JJTSTRINGLITERAL:
  -            case XPathTreeConstants.JJTDECIMALLITERAL:
  -            case XPathTreeConstants.JJTDOUBLELITERAL:
  -            case XPathTreeConstants.JJTFUNCTIONCALL:
  -            case XPathTreeConstants.JJTVARNAME:
  -                m_axisType = -1;
  -                super.jjtAddChild(n, 0);
  -
  -                break;
  -
  -            case XPathTreeConstants.JJTEXPRSEQUENCE:
  -                m_axisType = -1;
  -                super.jjtAddChild(n.jjtGetChild(0), 0);
  -
  -                break;
  -
  -            case XPathTreeConstants.JJTPREDICATES:
  -
  -                int size = n.jjtGetNumChildren();
  -
  -                for (int j = 0; j < size; j++)
  -                {
  -                    super.jjtAddChild(n.jjtGetChild(j), size - j);
  -                }
  -
  -                break;
  -
  -            default:
  -                System.out.println("not implemented yet " + n.getId());
  -        }
  -    }
  -
  -    /**
  -     * @see org.apache.xpath.rwapi.impl.ExprImpl#getString(StringBuffer, 
boolean)
  -     */
  -    protected void getString(StringBuffer expr, boolean abbreviate)
  -    {
  -        try
  -        {
  -            if (m_axisType == -1)
  -            {
  -                ExprImpl p = (ExprImpl) getPrimaryExpr();
  -
  -                if ((p.getExprType() == SEQUENCE_EXPR)
  -                        || (p.getExprType() == COMBINE_EXPR)
  -                        || (p.getExprType() == RANGE_EXPR))
  -                {
  -                    expr.append('(');
  -                    p.getString(expr, abbreviate);
  -                    expr.append(')');
  -                }
  -                else
  -                {
  -                    p.getString(expr, abbreviate);
  -                }
  -            }
  -            else
  -            {
  -                if (abbreviate && (m_axisType == AXIS_CHILD))
  -                {
  -                    ((ExprImpl) getStepNodeTest()).getString(expr, 
abbreviate);
  -                }
  -                else if (abbreviate && (m_axisType == AXIS_ATTRIBUTE))
  -                {
  -                    expr.append("@");
  -                    ((ExprImpl) getStepNodeTest()).getString(expr, 
abbreviate);
  -                }
  -                else if (abbreviate && (m_axisType == AXIS_PARENT)
  -                             && getStepNodeTest().isKindTest()
  -                             && (getStepNodeTest().getKindTest() == 
NodeTest.ANY_KIND_TEST))
  -                {
  -                    expr.append("..");
  -                }
  -                else if (abbreviate && (m_axisType == 
AXIS_DESCENDANT_OR_SELF)
  -                             && getStepNodeTest().isKindTest()
  -                             && (getStepNodeTest().getKindTest() == 
NodeTest.ANY_KIND_TEST))
  -                {
  -                    // empty step
  -                }
  -                else
  -                {
  -                    expr.append(getAxisName()).append("::");
  -                    ((ExprImpl) getStepNodeTest()).getString(expr, 
abbreviate);
  -                }
  -            }
  -
  -            // Predicates
  -            int size = getPredicateCount();
  -
  -            for (int i = 0; i < size; i++)
  -            {
  -                expr.append('[');
  -                ((ExprImpl) getPredicateAt(i)).getString(expr, abbreviate);
  -                expr.append(']');
  -            }
  -        }
  -        catch (XPathException e)
  -        {
  -            // never
  -        }
  -    }
  -
  -    /**
  -     * @see org.apache.xpath.rwapi.impl.parser.SimpleNode#canBeReduced()
  -     */
  -    public boolean canBeReduced()
  -    {
  -        // StepExpr can be reduce whenever it's a primary expression and
  -        // there is no predicate
  -        int et = ((Expr) children[0]).getExprType();
  -
  -        return ((getPredicateCount() == 0) && (et == LITERAL_EXPR))
  -               || (et == FUNCTION_CALL_EXPR) || (et == SEQUENCE_EXPR)
  -               || (et == VARIABLE_REF_EXPR) || (et == ARITHMETIC_EXPR);
  -    }
  -}
  +/*
  + * The Apache Software License, Version 1.1
  + *
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights
  + * reserved.
  + *
  + * Redistribution and use in source and binary forms, with or without
  + * modification, are permitted provided that the following conditions
  + * are met:
  + *
  + * 1. Redistributions of source code must retain the above copyright
  + *    notice, this list of conditions and the following disclaimer.
  + *
  + * 2. Redistributions in binary form must reproduce the above copyright
  + *    notice, this list of conditions and the following disclaimer in
  + *    the documentation and/or other materials provided with the
  + *    distribution.
  + *
  + * 3. The end-user documentation included with the redistribution,
  + *    if any, must include the following acknowledgment:
  + *       "This product includes software developed by the
  + *        Apache Software Foundation (http://www.apache.org/)."
  + *    Alternately, this acknowledgment may appear in the software itself,
  + *    if and wherever such third-party acknowledgments normally appear.
  + *
  + * 4. The names "Xalan" and "Apache Software Foundation" must
  + *    not be used to endorse or promote products derived from this
  + *    software without prior written permission. For written
  + *    permission, please contact [EMAIL PROTECTED]
  + *
  + * 5. Products derived from this software may not be called "Apache",
  + *    nor may "Apache" appear in their name, without prior written
  + *    permission of the Apache Software Foundation.
  + *
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  + * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  + * SUCH DAMAGE.
  + * ====================================================================
  + *
  + * This software consists of voluntary contributions made by many
  + * individuals on behalf of the Apache Software Foundation and was
  + * originally based on software copyright (c) 1999, Lotus
  + * Development Corporation., http://www.lotus.com.  For more
  + * information on the Apache Software Foundation, please see
  + * <http://www.apache.org/>.
  + */
  +package org.apache.xpath.rwapi.impl;
  +
  +import org.apache.xpath.rwapi.XPathException;
  +import org.apache.xpath.rwapi.expression.Expr;
  +import org.apache.xpath.rwapi.expression.NodeTest;
  +import org.apache.xpath.rwapi.expression.StepExpr;
  +import org.apache.xpath.rwapi.expression.Visitor;
  +import org.apache.xpath.rwapi.impl.parser.Axis;
  +import org.apache.xpath.rwapi.impl.parser.Node;
  +import org.apache.xpath.rwapi.impl.parser.XPath;
  +import org.apache.xpath.rwapi.impl.parser.XPathTreeConstants;
  +
  +
  +/**
  + * Implementation of step expression
  + */
  +public class StepExprImpl extends ExprImpl implements StepExpr
  +{
  +    final static boolean[] AXIS_FORWARD = 
  +                                          {
  +                                              false, true, true, false, true,
  +                                              true, true, false, true, false,
  +                                              true, false, true, false
  +                                          };
  +
  +    /**
  +     * Axis type. -1 whenever this step expr is a primary expr
  +     */
  +    short m_axisType = -2;
  +
  +    /**
  +     * Constructor for StepExprImpl.
  +     * @param i
  +     */
  +    public StepExprImpl(int i)
  +    {
  +        super(i);
  +    }
  +
  +    /**
  +     * Constructor for StepExprImpl.
  +     * @param p
  +     * @param i
  +     */
  +    public StepExprImpl(XPath p, int i)
  +    {
  +        super(p, i);
  +    }
  +
  +    /**
  +     * Constructor for StepExprImpl.
  +     * @param axisType
  +     * @param NodeTest
  +     */
  +    public StepExprImpl(short axisType, NodeTest nodeTest)
  +    {
  +        super(XPathTreeConstants.JJTSTEPEXPR);
  +
  +        m_axisType = axisType;
  +        super.jjtAddChild((Node) nodeTest, 0);
  +
  +        //  super.jjtAddChild(new 
OperatorImpl(XPathTreeConstants.JJTPREDICATES), 1);
  +    }
  +
  +    /**
  +     * @see org.apache.xpath.rwapi.expression.StepExpr#getPredicateAt(int)
  +     */
  +    public Expr getPredicateAt(int i)
  +    {
  +        return (Expr) children[i + 1];
  +    }
  +
  +    /**
  +     * @see org.apache.xpath.rwapi.expression.StepExpr#getPredicateCount()
  +     */
  +    public int getPredicateCount()
  +    {
  +        return children.length - 1;
  +    }
  +
  +    /**
  +     * @see org.apache.xpath.rwapi.expression.StepExpr#appendPredicate(Expr)
  +     */
  +    public void appendPredicate(Expr predicate)
  +    {
  +        super.jjtAddChild((Node) predicate, children.length);
  +    }
  +
  +    /**
  +     * @see org.apache.xpath.rwapi.expression.StepExpr#removePredicate(Expr)
  +     */
  +    public void removePredicate(Expr predicate) {}
  +
  +    /**
  +     * @see org.apache.xpath.rwapi.expression.Visitable#visit(Visitor)
  +     */
  +    public void visit(Visitor visitor)
  +    {
  +        visitor.visitStep(this);
  +    }
  +
  +    /**
  +     * @see org.apache.xpath.rwapi.expression.StepExpr#isForwardStep()
  +     */
  +    public boolean isForwardStep()
  +    {
  +        return (m_axisType != -1) && AXIS_FORWARD[m_axisType];
  +    }
  +
  +    /**
  +     * @see org.apache.xpath.rwapi.expression.StepExpr#isReversedStep()
  +     */
  +    public boolean isReversedStep()
  +    {
  +        return (m_axisType != -1) && !AXIS_FORWARD[m_axisType];
  +    }
  +
  +    /**
  +     * @see org.apache.xpath.rwapi.expression.StepExpr#isPrimaryExpr()
  +     */
  +    public boolean isPrimaryExpr()
  +    {
  +        return m_axisType == -1;
  +    }
  +
  +    /**
  +     * @see org.apache.xpath.rwapi.expression.StepExpr#getAxisType()
  +     */
  +    public short getAxisType() throws XPathException
  +    {
  +        if (m_axisType == -1)
  +        {
  +            throw new XPathException("Invalid call of this method on primary 
expression");
  +        }
  +
  +        return m_axisType;
  +    }
  +
  +    /**
  +     * @see org.apache.xpath.rwapi.expression.StepExpr#setAxisType(short)
  +     */
  +    public void setAxisType(short newType) throws XPathException
  +    {
  +        if (m_axisType == -1)
  +        {
  +            throw new XPathException("Invalid call of this method on primary 
expression");
  +        }
  +
  +        m_axisType = newType;
  +    }
  +
  +    /**
  +     * @see org.apache.xpath.rwapi.expression.StepExpr#getAxisName()
  +     */
  +    public String getAxisName() throws XPathException
  +    {
  +        if (m_axisType == -1)
  +        {
  +            throw new XPathException("Invalid call of this method on primary 
expression");
  +        }
  +
  +        return StepExprImpl.FULL_AXIS_NAME[m_axisType];
  +    }
  +
  +    /**
  +     * @see org.apache.xpath.rwapi.expression.StepExpr#getStepNodeTest()
  +     */
  +    public NodeTest getStepNodeTest() throws XPathException
  +    {
  +        if (m_axisType == -1)
  +        {
  +            throw new XPathException("Invalid call of this method on step 
compose of primary expression");
  +        }
  +
  +        return (NodeTest) children[0];
  +    }
  +
  +    /**
  +     * @see org.apache.xpath.rwapi.expression.StepExpr#getPrimaryExpr()
  +     */
  +    public Expr getPrimaryExpr() throws XPathException
  +    {
  +        if (m_axisType != -1)
  +        {
  +            throw new XPathException("Invalid call of this method on step 
compose of node test");
  +        }
  +
  +        return (Expr) children[0];
  +    }
  +
  +    /**
  +     * @see org.apache.xpath.rwapi.expression.StepExpr#cloneStep()
  +     */
  +    public StepExpr cloneStep()
  +    {
  +        return null;
  +    }
  +
  +    /**
  +     * @see org.apache.xpath.rwapi.expression.Expr#getExprType()
  +     */
  +    public short getExprType()
  +    {
  +        return StepExprImpl.STEP;
  +    }
  +
  +    /**
  +     * @see org.apache.xpath.rwapi.expression.Expr#cloneExpression()
  +     */
  +    public Expr cloneExpression()
  +    {
  +        return null;
  +    }
  +
  +    /**
  +     * @see org.apache.xpath.rwapi.impl.parser.Node#jjtAddChild(Node, int)
  +     */
  +    public void jjtAddChild(Node n, int i)
  +    {
  +        switch (n.getId())
  +        {
  +            case XPathTreeConstants.JJTAT:
  +                m_axisType = AXIS_ATTRIBUTE;
  +
  +                break;
  +
  +            case XPathTreeConstants.JJTAXISCHILD:
  +            case XPathTreeConstants.JJTAXISDESCENDANT:
  +            case XPathTreeConstants.JJTAXISANCESTOR:
  +            case XPathTreeConstants.JJTAXISSELF:
  +            case XPathTreeConstants.JJTAXISDESCENDANTORSELF:
  +            case XPathTreeConstants.JJTAXISFOLLOWINGSIBLING:
  +            case XPathTreeConstants.JJTAXISFOLLOWING:
  +            case XPathTreeConstants.JJTAXISNAMESPACE:
  +            case XPathTreeConstants.JJTAXISPARENT:
  +            case XPathTreeConstants.JJTAXISPRECEDINGSIBLING:
  +            case XPathTreeConstants.JJTAXISPRECEDING:
  +            case XPathTreeConstants.JJTAXISANCESTORORSELF:
  +                m_axisType = ((Axis) n).getAxis();
  +
  +                break;
  +
  +            case XPathTreeConstants.JJTNAMETEST:
  +
  +                // At production
  +                super.jjtAddChild(n, 0);
  +
  +                break;
  +
  +            case XPathTreeConstants.JJTNODETEST:
  +
  +                if (m_axisType == -2)
  +                {
  +                    // NodeTest production
  +                    m_axisType = AXIS_CHILD;
  +                    super.jjtAddChild(n.jjtGetChild(0), 0);
  +                }
  +                else
  +                {
  +                    // reduce
  +                    super.jjtAddChild(n.jjtGetChild(0), 0);
  +                }
  +
  +                break;
  +
  +            case XPathTreeConstants.JJTDOTDOT:
  +                m_axisType = AXIS_PARENT;
  +
  +                KindTestImpl node = new KindTestImpl();
  +                node.m_kindTest = NodeTest.ANY_KIND_TEST;
  +                super.jjtAddChild(node, 0);
  +
  +                break;
  +
  +            case XPathTreeConstants.JJTDOT:
  +
  +                // TODO : need to extend XPath API?
  +                break;
  +
  +            case XPathTreeConstants.JJTINTEGERLITERAL:
  +            case XPathTreeConstants.JJTSTRINGLITERAL:
  +            case XPathTreeConstants.JJTDECIMALLITERAL:
  +            case XPathTreeConstants.JJTDOUBLELITERAL:
  +            case XPathTreeConstants.JJTFUNCTIONCALL:
  +            case XPathTreeConstants.JJTVARNAME:
  +                m_axisType = -1;
  +                super.jjtAddChild(n, 0);
  +
  +                break;
  +
  +            case XPathTreeConstants.JJTEXPRSEQUENCE:
  +                m_axisType = -1;
  +                super.jjtAddChild(n.jjtGetChild(0), 0);
  +
  +                break;
  +
  +            case XPathTreeConstants.JJTPREDICATES:
  +
  +                int size = n.jjtGetNumChildren();
  +
  +                for (int j = 0; j < size; j++)
  +                {
  +                    super.jjtAddChild(n.jjtGetChild(j), size - j);
  +                }
  +
  +                break;
  +
  +            default:
  +                System.out.println("not implemented yet " + n.getId());
  +        }
  +    }
  +
  +    /**
  +     * @see org.apache.xpath.rwapi.impl.ExprImpl#getString(StringBuffer, 
boolean)
  +     */
  +    protected void getString(StringBuffer expr, boolean abbreviate)
  +    {
  +        try
  +        {
  +            if (m_axisType == -1)
  +            {
  +                ExprImpl p = (ExprImpl) getPrimaryExpr();
  +
  +                if ((p.getExprType() == SEQUENCE_EXPR)
  +                        || (p.getExprType() == COMBINE_EXPR)
  +                        || (p.getExprType() == RANGE_EXPR))
  +                {
  +                    expr.append('(');
  +                    p.getString(expr, abbreviate);
  +                    expr.append(')');
  +                }
  +                else
  +                {
  +                    p.getString(expr, abbreviate);
  +                }
  +            }
  +            else
  +            {
  +                if (abbreviate && (m_axisType == AXIS_CHILD))
  +                {
  +                    ((ExprImpl) getStepNodeTest()).getString(expr, 
abbreviate);
  +                }
  +                else if (abbreviate && (m_axisType == AXIS_ATTRIBUTE))
  +                {
  +                    expr.append("@");
  +                    ((ExprImpl) getStepNodeTest()).getString(expr, 
abbreviate);
  +                }
  +                else if (abbreviate && (m_axisType == AXIS_PARENT)
  +                             && getStepNodeTest().isKindTest()
  +                             && (getStepNodeTest().getKindTest() == 
NodeTest.ANY_KIND_TEST))
  +                {
  +                    expr.append("..");
  +                }
  +                else if (abbreviate && (m_axisType == 
AXIS_DESCENDANT_OR_SELF)
  +                             && getStepNodeTest().isKindTest()
  +                             && (getStepNodeTest().getKindTest() == 
NodeTest.ANY_KIND_TEST))
  +                {
  +                    // empty step
  +                }
  +                else
  +                {
  +                    expr.append(getAxisName()).append("::");
  +                    ((ExprImpl) getStepNodeTest()).getString(expr, 
abbreviate);
  +                }
  +            }
  +
  +            // Predicates
  +            int size = getPredicateCount();
  +
  +            for (int i = 0; i < size; i++)
  +            {
  +                expr.append('[');
  +                ((ExprImpl) getPredicateAt(i)).getString(expr, abbreviate);
  +                expr.append(']');
  +            }
  +        }
  +        catch (XPathException e)
  +        {
  +            // never
  +        }
  +    }
  +
  +    /**
  +     * @see org.apache.xpath.rwapi.impl.parser.SimpleNode#canBeReduced()
  +     */
  +    public boolean canBeReduced()
  +    {
  +        // StepExpr can be reduce whenever it's a primary expression and
  +        // there is no predicate
  +        int et = ((Expr) children[0]).getExprType();
  +
  +        return ((getPredicateCount() == 0) && (et == LITERAL_EXPR))
  +               || (et == FUNCTION_CALL_EXPR) || (et == SEQUENCE_EXPR)
  +               || (et == VARIABLE_REF_EXPR) || (et == ARITHMETIC_EXPR);
  +    }
  +}
  
  
  
  1.1.2.2   +1 -1      
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/ExpressionFactoryImpl.java
  
  Index: ExpressionFactoryImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/ExpressionFactoryImpl.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- ExpressionFactoryImpl.java        13 Dec 2002 21:50:44 -0000      1.1.2.1
  +++ ExpressionFactoryImpl.java        30 Jan 2003 00:45:36 -0000      1.1.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  
  1.1.2.2   +1 -1      
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/InstanceOfExprImpl.java
  
  Index: InstanceOfExprImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/InstanceOfExprImpl.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- InstanceOfExprImpl.java   13 Dec 2002 21:50:44 -0000      1.1.2.1
  +++ InstanceOfExprImpl.java   30 Jan 2003 00:45:36 -0000      1.1.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  
  1.1.2.2   +1 -1      
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/VariableImpl.java
  
  Index: VariableImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/VariableImpl.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- VariableImpl.java 13 Dec 2002 21:50:44 -0000      1.1.2.1
  +++ VariableImpl.java 30 Jan 2003 00:45:36 -0000      1.1.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  
  1.1.2.2   +1 -1      
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/XPathFactoryImpl.java
  
  Index: XPathFactoryImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/XPathFactoryImpl.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- XPathFactoryImpl.java     13 Dec 2002 21:50:43 -0000      1.1.2.1
  +++ XPathFactoryImpl.java     30 Jan 2003 00:45:36 -0000      1.1.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  
  1.1.2.2   +1 -1      
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/CastableExprImpl.java
  
  Index: CastableExprImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/CastableExprImpl.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- CastableExprImpl.java     13 Dec 2002 21:50:44 -0000      1.1.2.1
  +++ CastableExprImpl.java     30 Jan 2003 00:45:36 -0000      1.1.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  
  1.1.2.2   +1 -1      
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/ExprImpl.java
  
  Index: ExprImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/ExprImpl.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- ExprImpl.java     13 Dec 2002 21:50:44 -0000      1.1.2.1
  +++ ExprImpl.java     30 Jan 2003 00:45:36 -0000      1.1.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  
  1.1.2.3   +517 -517  
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/OperatorImpl.java
  
  Index: OperatorImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/OperatorImpl.java,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- OperatorImpl.java 23 Jan 2003 19:36:49 -0000      1.1.2.2
  +++ OperatorImpl.java 30 Jan 2003 00:45:36 -0000      1.1.2.3
  @@ -1,517 +1,517 @@
  -/*
  - * The Apache Software License, Version 1.1
  - *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights
  - * reserved.
  - *
  - * Redistribution and use in source and binary forms, with or without
  - * modification, are permitted provided that the following conditions
  - * are met:
  - *
  - * 1. Redistributions of source code must retain the above copyright
  - *    notice, this list of conditions and the following disclaimer.
  - *
  - * 2. Redistributions in binary form must reproduce the above copyright
  - *    notice, this list of conditions and the following disclaimer in
  - *    the documentation and/or other materials provided with the
  - *    distribution.
  - *
  - * 3. The end-user documentation included with the redistribution,
  - *    if any, must include the following acknowledgment:
  - *       "This product includes software developed by the
  - *        Apache Software Foundation (http://www.apache.org/)."
  - *    Alternately, this acknowledgment may appear in the software itself,
  - *    if and wherever such third-party acknowledgments normally appear.
  - *
  - * 4. The names "Xalan" and "Apache Software Foundation" must
  - *    not be used to endorse or promote products derived from this
  - *    software without prior written permission. For written
  - *    permission, please contact [EMAIL PROTECTED]
  - *
  - * 5. Products derived from this software may not be called "Apache",
  - *    nor may "Apache" appear in their name, without prior written
  - *    permission of the Apache Software Foundation.
  - *
  - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  - * SUCH DAMAGE.
  - * ====================================================================
  - *
  - * This software consists of voluntary contributions made by many
  - * individuals on behalf of the Apache Software Foundation and was
  - * originally based on software copyright (c) 1999, Lotus
  - * Development Corporation., http://www.lotus.com.  For more
  - * information on the Apache Software Foundation, please see
  - * <http://www.apache.org/>.
  - */
  -package org.apache.xpath.rwapi.impl;
  -
  -import org.apache.xpath.rwapi.XPathException;
  -import org.apache.xpath.rwapi.expression.Expr;
  -import org.apache.xpath.rwapi.expression.OperatorExpr;
  -import org.apache.xpath.rwapi.expression.Visitor;
  -import org.apache.xpath.rwapi.impl.parser.Node;
  -import org.apache.xpath.rwapi.impl.parser.SimpleNode;
  -import org.apache.xpath.rwapi.impl.parser.Token;
  -import org.apache.xpath.rwapi.impl.parser.XPath;
  -import org.apache.xpath.rwapi.impl.parser.XPathTreeConstants;
  -
  -
  -/**
  - *
  - */
  -public class OperatorImpl extends ExprImpl implements OperatorExpr
  -{
  -    /**
  -     * Mapping between operation type and it's external representation
  -     */
  -    final private static String[] OPTYPE2STRING = 
  -                                                  {
  -                                                      "|", "intersect", 
"except",
  -                                                      "+", "-", "to", "eq",
  -                                                      "ne", "lt", "le", "gt",
  -                                                      "ge", "=", "!=", "<", 
"<=",
  -                                                      ">", ">=", "is", 
"isnot",
  -                                                      "<<", ">>", "and", 
"or",
  -                                                      "+", "-", "/", "//", 
",",
  -                                                      "*", "div", "idiv", 
"mod"
  -                                                  };
  -
  -    /**
  -            * Indicate whether space is needed around the operator
  -             */
  -    final private static boolean[] SPACE_NEEDED = 
  -                                                  {
  -                                                      false, true, true, 
false,
  -                                                      false, true, true, 
true,
  -                                                      true, true, true, true,
  -                                                      false, false, false, 
false,
  -                                                      false, false, true, 
true,
  -                                                      false, false, true, 
true,
  -                                                      false, false, false, 
false,
  -                                                      false, false, true, 
true,
  -                                                      true
  -                                                  };
  -    short m_exprType;
  -    short m_opType;
  -
  -    /**
  -     * Constructor for OperatorImpl.
  -     * @param i
  -     */
  -    public OperatorImpl(int i)
  -    {
  -        super(i);
  -
  -        switch (i)
  -        {
  -            case XPathTreeConstants.JJTEXPRSEQUENCE:
  -                m_exprType = SEQUENCE_EXPR;
  -                m_opType = COMMA;
  -
  -                break;
  -
  -            case XPathTreeConstants.JJTUNARYEXPR:
  -                m_exprType = UNARY_EXPR;
  -
  -                break;
  -
  -            case XPathTreeConstants.JJTPATHEXPR:
  -                m_exprType = PATH_EXPR;
  -                m_opType = SLASH_STEP;
  -
  -                break;
  -
  -            case XPathTreeConstants.JJTUNIONEXPR:
  -                m_exprType = COMBINE_EXPR;
  -
  -                // opType is not known yet
  -                break;
  -
  -            case XPathTreeConstants.JJTFUNCTIONCALL:
  -
  -                // ignore : see FunctionCallImpl subclass
  -                break;
  -
  -            case XPathTreeConstants.JJTADDITIVEEXPR:
  -            case XPathTreeConstants.JJTMULTIPLICATIVEEXPR:
  -                m_exprType = ARITHMETIC_EXPR;
  -
  -                // opType is not known yet
  -                break;
  -
  -            case XPathTreeConstants.JJTOREXPR:
  -            case XPathTreeConstants.JJTANDEXPR:
  -                m_exprType = LOGICAL_EXPR;
  -
  -                //   opType is not known yet
  -                break;
  -
  -            case XPathTreeConstants.JJTCOMPARISONEXPR:
  -                m_exprType = COMPARISON_EXPR;
  -
  -                //                   opType is not known yet
  -                break;
  -
  -            case XPathTreeConstants.JJTRANGEEXPR:
  -                m_exprType = RANGE_EXPR;
  -                m_opType = RANGE;
  -
  -                break;
  -
  -            default:
  -                System.out.println("not implemented yet:" + i);
  -        }
  -    }
  -
  -    /**
  -     * Constructor for OperatorImpl.
  -     * @param p
  -     * @param i
  -     */
  -    public OperatorImpl(XPath p, int i)
  -    {
  -        super(p, i);
  -    }
  -
  -    /**
  -     * @see org.apache.xpath.rwapi.expression.Expr#getExprType()
  -     */
  -    public short getExprType()
  -    {
  -        return m_exprType;
  -    }
  -
  -    /**
  -     * @see org.apache.xpath.rwapi.expression.Expr#cloneExpression()
  -     */
  -    public Expr cloneExpression()
  -    {
  -        return null;
  -    }
  -
  -    /**
  -     * @see org.apache.xpath.rwapi.expression.Visitable#visit(Visitor)
  -     */
  -    public void visit(Visitor visitor)
  -    {
  -        int count = getOperandCount();
  -
  -        for (int i = 0; i < count; i++)
  -        {
  -            getOperand(i).visit(visitor);
  -        }
  -    }
  -
  -    /**
  -     * @see org.apache.xpath.rwapi.expression.OperatorExpr#addOperand(Expr)
  -     */
  -    public void addOperand(Expr operand) throws XPathException
  -    {
  -        super.jjtAddChild((Node) operand,
  -                          (children == null) ? 0 : children.length);
  -    }
  -
  -    /**
  -     * @see org.apache.xpath.rwapi.expression.OperatorExpr#getOperand(int)
  -     */
  -    public Expr getOperand(int i)
  -    {
  -        if (children == null)
  -        {
  -            throw new ArrayIndexOutOfBoundsException();
  -        }
  -
  -        return (Expr) children[i];
  -    }
  -
  -    /**
  -     * @see org.apache.xpath.rwapi.expression.OperatorExpr#getOperandCount()
  -     */
  -    public int getOperandCount()
  -    {
  -        return (children == null) ? 0 : children.length;
  -    }
  -
  -    /**
  -     * @see org.apache.xpath.rwapi.expression.OperatorExpr#getOperatorType()
  -     */
  -    public short getOperatorType()
  -    {
  -        return m_opType;
  -    }
  -
  -    /**
  -     * @see 
org.apache.xpath.rwapi.expression.OperatorExpr#removeOperand(Expr)
  -     */
  -    public void removeOperand(Expr operand) throws XPathException {}
  -
  -    /**
  -     * @see org.apache.xpath.rwapi.impl.parser.Node#jjtAddChild(Node, int)
  -     */
  -    public void jjtAddChild(Node n, int i)
  -    {
  -        // Filter operator
  -        if (n.getId() == XPathTreeConstants.JJTSLASH)
  -        {
  -            // Filter
  -        }
  -             else if (n.getId() == XPathTreeConstants.JJTMINUS)
  -                             {
  -                                     // Minus expression
  -                                     m_opType = MINUS_UNARY;
  -                             }else if (n.getId() == 
XPathTreeConstants.JJTPLUS)
  -             {
  -                     // Plus expression
  -                     m_opType = PLUS_UNARY;
  -             }
  -        else
  -        {
  -            //int last = (children == null) ? 0 : children.length;
  -            if (((SimpleNode) n).canBeReduced())
  -            {
  -                super.jjtInsertChild(n.jjtGetChild(0));
  -            }
  -            else
  -            {
  -                super.jjtInsertChild(n);
  -            }
  -        }
  -    }
  -
  -    /**
  -     * @see org.apache.xpath.rwapi.impl.parser.SimpleNode#canBeReduced()
  -     */
  -    public boolean canBeReduced()
  -    {
  -        switch (m_exprType)
  -        {
  -            case UNARY_EXPR:
  -
  -                if ((m_opType != MINUS_UNARY) && (m_opType != PLUS_UNARY))
  -                {
  -                    return true;
  -                }
  -
  -            case SEQUENCE_EXPR:
  -                return false;
  -        }
  -
  -        return super.canBeReduced();
  -    }
  -
  -    /**
  -     * Gets operator as a char
  -     */
  -    protected String getOperatorChar()
  -    {
  -        return OPTYPE2STRING[m_opType];
  -    }
  -
  -    /**
  -     * Tell is spaces are needed around the operator
  -     */
  -    protected boolean isSpaceNeeded()
  -    {
  -        return SPACE_NEEDED[m_opType];
  -    }
  -
  -    /**
  -     * Gets expression as external string representation
  -     */
  -    protected void getString(StringBuffer expr, boolean abbreviate)
  -    {
  -        int size = getOperandCount();
  -        String oper = getOperatorChar();
  -        ExprImpl op;
  -
  -        if (m_opType == MINUS_UNARY || m_opType == PLUS_UNARY)
  -        {
  -            expr.append(oper);
  -        }
  -
  -        for (int i = 0; i < size; i++)
  -        {
  -            op = (ExprImpl) getOperand(i);
  -
  -            if (op.getExprType() == ARITHMETIC_EXPR)
  -            {
  -                expr.append('(');
  -            }
  -
  -            op.getString(expr, abbreviate);
  -
  -            if (op.getExprType() == ARITHMETIC_EXPR)
  -            {
  -                expr.append(')');
  -            }
  -
  -            if (i < (size - 1))
  -            {
  -                if (isSpaceNeeded())
  -                {
  -                    expr.append(' ');
  -                }
  -
  -                expr.append(oper);
  -
  -                if (isSpaceNeeded())
  -                {
  -                    expr.append(' ');
  -                }
  -            }
  -        }
  -    }
  -
  -    /**
  -     * @see org.apache.xpath.rwapi.impl.parser.SimpleNode#processToken(Token)
  -     */
  -    public void processToken(Token token)
  -    {
  -        if (m_exprType == ARITHMETIC_EXPR)
  -        {
  -            String op = token.image.trim();
  -
  -            if (op.equals("+"))
  -            {
  -                m_opType = PLUS_ADDITIVE;
  -            }
  -            else if (op.equals("-"))
  -            {
  -                m_opType = MINUS_ADDITIVE;
  -            }
  -            else if (op.equals("*"))
  -            {
  -                m_opType = MULT_PRODUCT;
  -            }
  -            else if (op.equals("div"))
  -            {
  -                m_opType = MULT_DIV;
  -            }
  -            else if (op.equals("idiv"))
  -            {
  -                m_opType = MULT_IDIV;
  -            }
  -            else if (op.equals("mod"))
  -            {
  -                m_opType = MULT_MOD;
  -            }
  -            else
  -            {
  -                // Case not recognized yet
  -            }
  -        }
  -        else if (m_exprType == COMBINE_EXPR)
  -        {
  -            String op = token.image.trim();
  -
  -            if (op.equals("|") || op.equals("union"))
  -            {
  -                m_opType = UNION_COMBINE;
  -            }
  -            else if (op.equals("intersect"))
  -            {
  -                m_opType = INTERSECT_COMBINE;
  -            }
  -            else if (op.equals("except"))
  -            {
  -                m_opType = EXCEPT_COMBINE;
  -            }
  -            else
  -            {
  -                // Case not recognized yet
  -            }
  -        }
  -        else if (m_exprType == LOGICAL_EXPR)
  -        {
  -            String op = token.image.trim();
  -
  -            if (op.equals("and"))
  -            {
  -                m_opType = AND_LOGICAL;
  -            }
  -            else
  -            {
  -                m_opType = OR_LOGICAL;
  -            }
  -        }
  -        else if (m_exprType == COMPARISON_EXPR)
  -        {
  -            String op = token.image.trim();
  -
  -            if (op.equals("="))
  -            {
  -                m_opType = EQUAL_GENERAL_COMPARISON;
  -            }
  -            else if (op.equals("!="))
  -            {
  -                m_opType = NOTEQUAL_GENERAL_COMPARISON;
  -            }
  -            else if (op.equals("<"))
  -            {
  -                m_opType = LESSTHAN_GENERAL_COMPARISON;
  -            }
  -            else if (op.equals("<="))
  -            {
  -                m_opType = LESSOREQUALTHAN_GENERAL_COMPARISON;
  -            }
  -            else if (op.equals(">"))
  -            {
  -                m_opType = GREATTHAN_GENERAL_COMPARISON;
  -            }
  -            else if (op.equals(">="))
  -            {
  -                m_opType = GREATOREQUALTHAN_GENERAL_COMPARISON;
  -            }
  -            else if (op.equals("eq"))
  -            {
  -                m_opType = EQUAL_VALUE_COMPARISON;
  -            }
  -            else if (op.equals("ne"))
  -            {
  -                m_opType = NOTEQUAL_VALUE_COMPARISON;
  -            }
  -            else if (op.equals("lt"))
  -            {
  -                m_opType = LESSTHAN_VALUE_COMPARISON;
  -            }
  -            else if (op.equals("le"))
  -            {
  -                m_opType = LESSOREQUALTHAN_VALUE_COMPARISON;
  -            }
  -            else if (op.equals("gt"))
  -            {
  -                m_opType = GREATTHAN_VALUE_COMPARISON;
  -            }
  -            else if (op.equals("ge"))
  -            {
  -                m_opType = GREATOREQUALTHAN_VALUE_COMPARISON;
  -            }
  -            else if (op.equals("is"))
  -            {
  -                m_opType = IS_NODE_COMPARISON;
  -            }
  -            else if (op.equals("isnot"))
  -            {
  -                m_opType = ISNOT_NODE_COMPARISON;
  -            }
  -            else if (op.equals("<<"))
  -            {
  -                m_opType = EARLIERTHAN_ORDER_COMPARISON;
  -            }
  -            else // if (op.equals(">>")) 
  -            {
  -                m_opType = LATERTHAN_ORDER_COMPARISON;
  -            }
  -        }
  -    }
  -}
  +/*
  + * The Apache Software License, Version 1.1
  + *
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights
  + * reserved.
  + *
  + * Redistribution and use in source and binary forms, with or without
  + * modification, are permitted provided that the following conditions
  + * are met:
  + *
  + * 1. Redistributions of source code must retain the above copyright
  + *    notice, this list of conditions and the following disclaimer.
  + *
  + * 2. Redistributions in binary form must reproduce the above copyright
  + *    notice, this list of conditions and the following disclaimer in
  + *    the documentation and/or other materials provided with the
  + *    distribution.
  + *
  + * 3. The end-user documentation included with the redistribution,
  + *    if any, must include the following acknowledgment:
  + *       "This product includes software developed by the
  + *        Apache Software Foundation (http://www.apache.org/)."
  + *    Alternately, this acknowledgment may appear in the software itself,
  + *    if and wherever such third-party acknowledgments normally appear.
  + *
  + * 4. The names "Xalan" and "Apache Software Foundation" must
  + *    not be used to endorse or promote products derived from this
  + *    software without prior written permission. For written
  + *    permission, please contact [EMAIL PROTECTED]
  + *
  + * 5. Products derived from this software may not be called "Apache",
  + *    nor may "Apache" appear in their name, without prior written
  + *    permission of the Apache Software Foundation.
  + *
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  + * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  + * SUCH DAMAGE.
  + * ====================================================================
  + *
  + * This software consists of voluntary contributions made by many
  + * individuals on behalf of the Apache Software Foundation and was
  + * originally based on software copyright (c) 1999, Lotus
  + * Development Corporation., http://www.lotus.com.  For more
  + * information on the Apache Software Foundation, please see
  + * <http://www.apache.org/>.
  + */
  +package org.apache.xpath.rwapi.impl;
  +
  +import org.apache.xpath.rwapi.XPathException;
  +import org.apache.xpath.rwapi.expression.Expr;
  +import org.apache.xpath.rwapi.expression.OperatorExpr;
  +import org.apache.xpath.rwapi.expression.Visitor;
  +import org.apache.xpath.rwapi.impl.parser.Node;
  +import org.apache.xpath.rwapi.impl.parser.SimpleNode;
  +import org.apache.xpath.rwapi.impl.parser.Token;
  +import org.apache.xpath.rwapi.impl.parser.XPath;
  +import org.apache.xpath.rwapi.impl.parser.XPathTreeConstants;
  +
  +
  +/**
  + *
  + */
  +public class OperatorImpl extends ExprImpl implements OperatorExpr
  +{
  +    /**
  +     * Mapping between operation type and it's external representation
  +     */
  +    final private static String[] OPTYPE2STRING = 
  +                                                  {
  +                                                      "|", "intersect", 
"except",
  +                                                      "+", "-", "to", "eq",
  +                                                      "ne", "lt", "le", "gt",
  +                                                      "ge", "=", "!=", "<", 
"<=",
  +                                                      ">", ">=", "is", 
"isnot",
  +                                                      "<<", ">>", "and", 
"or",
  +                                                      "+", "-", "/", "//", 
",",
  +                                                      "*", "div", "idiv", 
"mod"
  +                                                  };
  +
  +    /**
  +            * Indicate whether space is needed around the operator
  +             */
  +    final private static boolean[] SPACE_NEEDED = 
  +                                                  {
  +                                                      false, true, true, 
false,
  +                                                      false, true, true, 
true,
  +                                                      true, true, true, true,
  +                                                      false, false, false, 
false,
  +                                                      false, false, true, 
true,
  +                                                      false, false, true, 
true,
  +                                                      false, false, false, 
false,
  +                                                      false, false, true, 
true,
  +                                                      true
  +                                                  };
  +    short m_exprType;
  +    short m_opType;
  +
  +    /**
  +     * Constructor for OperatorImpl.
  +     * @param i
  +     */
  +    public OperatorImpl(int i)
  +    {
  +        super(i);
  +
  +        switch (i)
  +        {
  +            case XPathTreeConstants.JJTEXPRSEQUENCE:
  +                m_exprType = SEQUENCE_EXPR;
  +                m_opType = COMMA;
  +
  +                break;
  +
  +            case XPathTreeConstants.JJTUNARYEXPR:
  +                m_exprType = UNARY_EXPR;
  +
  +                break;
  +
  +            case XPathTreeConstants.JJTPATHEXPR:
  +                m_exprType = PATH_EXPR;
  +                m_opType = SLASH_STEP;
  +
  +                break;
  +
  +            case XPathTreeConstants.JJTUNIONEXPR:
  +                m_exprType = COMBINE_EXPR;
  +
  +                // opType is not known yet
  +                break;
  +
  +            case XPathTreeConstants.JJTFUNCTIONCALL:
  +
  +                // ignore : see FunctionCallImpl subclass
  +                break;
  +
  +            case XPathTreeConstants.JJTADDITIVEEXPR:
  +            case XPathTreeConstants.JJTMULTIPLICATIVEEXPR:
  +                m_exprType = ARITHMETIC_EXPR;
  +
  +                // opType is not known yet
  +                break;
  +
  +            case XPathTreeConstants.JJTOREXPR:
  +            case XPathTreeConstants.JJTANDEXPR:
  +                m_exprType = LOGICAL_EXPR;
  +
  +                //   opType is not known yet
  +                break;
  +
  +            case XPathTreeConstants.JJTCOMPARISONEXPR:
  +                m_exprType = COMPARISON_EXPR;
  +
  +                //                   opType is not known yet
  +                break;
  +
  +            case XPathTreeConstants.JJTRANGEEXPR:
  +                m_exprType = RANGE_EXPR;
  +                m_opType = RANGE;
  +
  +                break;
  +
  +            default:
  +                System.out.println("not implemented yet:" + i);
  +        }
  +    }
  +
  +    /**
  +     * Constructor for OperatorImpl.
  +     * @param p
  +     * @param i
  +     */
  +    public OperatorImpl(XPath p, int i)
  +    {
  +        super(p, i);
  +    }
  +
  +    /**
  +     * @see org.apache.xpath.rwapi.expression.Expr#getExprType()
  +     */
  +    public short getExprType()
  +    {
  +        return m_exprType;
  +    }
  +
  +    /**
  +     * @see org.apache.xpath.rwapi.expression.Expr#cloneExpression()
  +     */
  +    public Expr cloneExpression()
  +    {
  +        return null;
  +    }
  +
  +    /**
  +     * @see org.apache.xpath.rwapi.expression.Visitable#visit(Visitor)
  +     */
  +    public void visit(Visitor visitor)
  +    {
  +        int count = getOperandCount();
  +
  +        for (int i = 0; i < count; i++)
  +        {
  +            getOperand(i).visit(visitor);
  +        }
  +    }
  +
  +    /**
  +     * @see org.apache.xpath.rwapi.expression.OperatorExpr#addOperand(Expr)
  +     */
  +    public void addOperand(Expr operand) throws XPathException
  +    {
  +        super.jjtAddChild((Node) operand,
  +                          (children == null) ? 0 : children.length);
  +    }
  +
  +    /**
  +     * @see org.apache.xpath.rwapi.expression.OperatorExpr#getOperand(int)
  +     */
  +    public Expr getOperand(int i)
  +    {
  +        if (children == null)
  +        {
  +            throw new ArrayIndexOutOfBoundsException();
  +        }
  +
  +        return (Expr) children[i];
  +    }
  +
  +    /**
  +     * @see org.apache.xpath.rwapi.expression.OperatorExpr#getOperandCount()
  +     */
  +    public int getOperandCount()
  +    {
  +        return (children == null) ? 0 : children.length;
  +    }
  +
  +    /**
  +     * @see org.apache.xpath.rwapi.expression.OperatorExpr#getOperatorType()
  +     */
  +    public short getOperatorType()
  +    {
  +        return m_opType;
  +    }
  +
  +    /**
  +     * @see 
org.apache.xpath.rwapi.expression.OperatorExpr#removeOperand(Expr)
  +     */
  +    public void removeOperand(Expr operand) throws XPathException {}
  +
  +    /**
  +     * @see org.apache.xpath.rwapi.impl.parser.Node#jjtAddChild(Node, int)
  +     */
  +    public void jjtAddChild(Node n, int i)
  +    {
  +        // Filter operator
  +        if (n.getId() == XPathTreeConstants.JJTSLASH)
  +        {
  +            // Filter
  +        }
  +             else if (n.getId() == XPathTreeConstants.JJTMINUS)
  +                             {
  +                                     // Minus expression
  +                                     m_opType = MINUS_UNARY;
  +                             }else if (n.getId() == 
XPathTreeConstants.JJTPLUS)
  +             {
  +                     // Plus expression
  +                     m_opType = PLUS_UNARY;
  +             }
  +        else
  +        {
  +            //int last = (children == null) ? 0 : children.length;
  +            if (((SimpleNode) n).canBeReduced())
  +            {
  +                super.jjtInsertChild(n.jjtGetChild(0));
  +            }
  +            else
  +            {
  +                super.jjtInsertChild(n);
  +            }
  +        }
  +    }
  +
  +    /**
  +     * @see org.apache.xpath.rwapi.impl.parser.SimpleNode#canBeReduced()
  +     */
  +    public boolean canBeReduced()
  +    {
  +        switch (m_exprType)
  +        {
  +            case UNARY_EXPR:
  +
  +                if ((m_opType != MINUS_UNARY) && (m_opType != PLUS_UNARY))
  +                {
  +                    return true;
  +                }
  +
  +            case SEQUENCE_EXPR:
  +                return false;
  +        }
  +
  +        return super.canBeReduced();
  +    }
  +
  +    /**
  +     * Gets operator as a char
  +     */
  +    protected String getOperatorChar()
  +    {
  +        return OPTYPE2STRING[m_opType];
  +    }
  +
  +    /**
  +     * Tell is spaces are needed around the operator
  +     */
  +    protected boolean isSpaceNeeded()
  +    {
  +        return SPACE_NEEDED[m_opType];
  +    }
  +
  +    /**
  +     * Gets expression as external string representation
  +     */
  +    protected void getString(StringBuffer expr, boolean abbreviate)
  +    {
  +        int size = getOperandCount();
  +        String oper = getOperatorChar();
  +        ExprImpl op;
  +
  +        if (m_opType == MINUS_UNARY || m_opType == PLUS_UNARY)
  +        {
  +            expr.append(oper);
  +        }
  +
  +        for (int i = 0; i < size; i++)
  +        {
  +            op = (ExprImpl) getOperand(i);
  +
  +            if (op.getExprType() == ARITHMETIC_EXPR)
  +            {
  +                expr.append('(');
  +            }
  +
  +            op.getString(expr, abbreviate);
  +
  +            if (op.getExprType() == ARITHMETIC_EXPR)
  +            {
  +                expr.append(')');
  +            }
  +
  +            if (i < (size - 1))
  +            {
  +                if (isSpaceNeeded())
  +                {
  +                    expr.append(' ');
  +                }
  +
  +                expr.append(oper);
  +
  +                if (isSpaceNeeded())
  +                {
  +                    expr.append(' ');
  +                }
  +            }
  +        }
  +    }
  +
  +    /**
  +     * @see org.apache.xpath.rwapi.impl.parser.SimpleNode#processToken(Token)
  +     */
  +    public void processToken(Token token)
  +    {
  +        if (m_exprType == ARITHMETIC_EXPR)
  +        {
  +            String op = token.image.trim();
  +
  +            if (op.equals("+"))
  +            {
  +                m_opType = PLUS_ADDITIVE;
  +            }
  +            else if (op.equals("-"))
  +            {
  +                m_opType = MINUS_ADDITIVE;
  +            }
  +            else if (op.equals("*"))
  +            {
  +                m_opType = MULT_PRODUCT;
  +            }
  +            else if (op.equals("div"))
  +            {
  +                m_opType = MULT_DIV;
  +            }
  +            else if (op.equals("idiv"))
  +            {
  +                m_opType = MULT_IDIV;
  +            }
  +            else if (op.equals("mod"))
  +            {
  +                m_opType = MULT_MOD;
  +            }
  +            else
  +            {
  +                // Case not recognized yet
  +            }
  +        }
  +        else if (m_exprType == COMBINE_EXPR)
  +        {
  +            String op = token.image.trim();
  +
  +            if (op.equals("|") || op.equals("union"))
  +            {
  +                m_opType = UNION_COMBINE;
  +            }
  +            else if (op.equals("intersect"))
  +            {
  +                m_opType = INTERSECT_COMBINE;
  +            }
  +            else if (op.equals("except"))
  +            {
  +                m_opType = EXCEPT_COMBINE;
  +            }
  +            else
  +            {
  +                // Case not recognized yet
  +            }
  +        }
  +        else if (m_exprType == LOGICAL_EXPR)
  +        {
  +            String op = token.image.trim();
  +
  +            if (op.equals("and"))
  +            {
  +                m_opType = AND_LOGICAL;
  +            }
  +            else
  +            {
  +                m_opType = OR_LOGICAL;
  +            }
  +        }
  +        else if (m_exprType == COMPARISON_EXPR)
  +        {
  +            String op = token.image.trim();
  +
  +            if (op.equals("="))
  +            {
  +                m_opType = EQUAL_GENERAL_COMPARISON;
  +            }
  +            else if (op.equals("!="))
  +            {
  +                m_opType = NOTEQUAL_GENERAL_COMPARISON;
  +            }
  +            else if (op.equals("<"))
  +            {
  +                m_opType = LESSTHAN_GENERAL_COMPARISON;
  +            }
  +            else if (op.equals("<="))
  +            {
  +                m_opType = LESSOREQUALTHAN_GENERAL_COMPARISON;
  +            }
  +            else if (op.equals(">"))
  +            {
  +                m_opType = GREATTHAN_GENERAL_COMPARISON;
  +            }
  +            else if (op.equals(">="))
  +            {
  +                m_opType = GREATOREQUALTHAN_GENERAL_COMPARISON;
  +            }
  +            else if (op.equals("eq"))
  +            {
  +                m_opType = EQUAL_VALUE_COMPARISON;
  +            }
  +            else if (op.equals("ne"))
  +            {
  +                m_opType = NOTEQUAL_VALUE_COMPARISON;
  +            }
  +            else if (op.equals("lt"))
  +            {
  +                m_opType = LESSTHAN_VALUE_COMPARISON;
  +            }
  +            else if (op.equals("le"))
  +            {
  +                m_opType = LESSOREQUALTHAN_VALUE_COMPARISON;
  +            }
  +            else if (op.equals("gt"))
  +            {
  +                m_opType = GREATTHAN_VALUE_COMPARISON;
  +            }
  +            else if (op.equals("ge"))
  +            {
  +                m_opType = GREATOREQUALTHAN_VALUE_COMPARISON;
  +            }
  +            else if (op.equals("is"))
  +            {
  +                m_opType = IS_NODE_COMPARISON;
  +            }
  +            else if (op.equals("isnot"))
  +            {
  +                m_opType = ISNOT_NODE_COMPARISON;
  +            }
  +            else if (op.equals("<<"))
  +            {
  +                m_opType = EARLIERTHAN_ORDER_COMPARISON;
  +            }
  +            else // if (op.equals(">>")) 
  +            {
  +                m_opType = LATERTHAN_ORDER_COMPARISON;
  +            }
  +        }
  +    }
  +}
  
  
  
  1.1.2.2   +1 -1      
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/ConditionalExprImpl.java
  
  Index: ConditionalExprImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/ConditionalExprImpl.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- ConditionalExprImpl.java  13 Dec 2002 21:50:44 -0000      1.1.2.1
  +++ ConditionalExprImpl.java  30 Jan 2003 00:45:36 -0000      1.1.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.2   +1 -1      
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/xalan/Attic/EvaluatorImpl.java
  
  Index: EvaluatorImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/xalan/Attic/EvaluatorImpl.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- EvaluatorImpl.java        13 Dec 2002 21:50:46 -0000      1.1.2.1
  +++ EvaluatorImpl.java        30 Jan 2003 00:45:36 -0000      1.1.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  
  1.1.2.2   +1 -1      
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/xalan/Attic/XObjectToSequence.java
  
  Index: XObjectToSequence.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/xalan/Attic/XObjectToSequence.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- XObjectToSequence.java    13 Dec 2002 21:50:46 -0000      1.1.2.1
  +++ XObjectToSequence.java    30 Jan 2003 00:45:36 -0000      1.1.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.3   +217 -217  
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/StepExpr.java
  
  Index: StepExpr.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/StepExpr.java,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- StepExpr.java     23 Jan 2003 19:36:49 -0000      1.1.2.2
  +++ StepExpr.java     30 Jan 2003 00:45:38 -0000      1.1.2.3
  @@ -1,217 +1,217 @@
  -/*
  - * The Apache Software License, Version 1.1
  - *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights
  - * reserved.
  - *
  - * Redistribution and use in source and binary forms, with or without
  - * modification, are permitted provided that the following conditions
  - * are met:
  - *
  - * 1. Redistributions of source code must retain the above copyright
  - *    notice, this list of conditions and the following disclaimer.
  - *
  - * 2. Redistributions in binary form must reproduce the above copyright
  - *    notice, this list of conditions and the following disclaimer in
  - *    the documentation and/or other materials provided with the
  - *    distribution.
  - *
  - * 3. The end-user documentation included with the redistribution,
  - *    if any, must include the following acknowledgment:
  - *       "This product includes software developed by the
  - *        Apache Software Foundation (http://www.apache.org/)."
  - *    Alternately, this acknowledgment may appear in the software itself,
  - *    if and wherever such third-party acknowledgments normally appear.
  - *
  - * 4. The names "Xalan" and "Apache Software Foundation" must
  - *    not be used to endorse or promote products derived from this
  - *    software without prior written permission. For written
  - *    permission, please contact [EMAIL PROTECTED]
  - *
  - * 5. Products derived from this software may not be called "Apache",
  - *    nor may "Apache" appear in their name, without prior written
  - *    permission of the Apache Software Foundation.
  - *
  - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  - * SUCH DAMAGE.
  - * ====================================================================
  - *
  - * This software consists of voluntary contributions made by many
  - * individuals on behalf of the Apache Software Foundation and was
  - * originally based on software copyright (c) 1999, Lotus
  - * Development Corporation., http://www.lotus.com.  For more
  - * information on the Apache Software Foundation, please see
  - * <http://www.apache.org/>.
  - */
  -package org.apache.xpath.rwapi.expression;
  -
  -import org.apache.xpath.rwapi.XPathException;
  -
  -
  -/**
  - * Represents a step expression.
  - * <pre>
  - * [20]   StepExpr   ::=   (ForwardStep |  ReverseStep |  Literal) Predicates
  - * [39]   ForwardStep   ::=   (ForwardAxis NodeTest) |  
AbbreviatedForwardStep
  - * [40]   ReverseStep   ::=   (ReverseAxis NodeTest) |  
AbbreviatedReverseStep
  - * </pre>
  - * @see <a href="http://www.w3.org/TR/xpath20/#id-axis-steps";>XPath 2.0 
specification</a>
  - */
  -public interface StepExpr extends Expr
  -{
  -    String[] FULL_AXIS_NAME = 
  -                              {
  -                                  "", "child", "descendant", "parent",
  -                                  "attribute", "self", "descendant-or-self",
  -                                  "ancestor", "following-sibling",
  -                                  "preceding-sibling", "following", 
"preceding",
  -                                  "namespace", "ancestor-or-self"
  -                              };
  -
  -    /**
  -     * Axis constant
  -     */
  -    short AXIS_CHILD = 1;
  -
  -    /**
  -     * Axis constant
  -     */
  -    short AXIS_DESCENDANT = 2;
  -
  -    /**
  -     * Axis constant
  -     */
  -    short AXIS_PARENT = 3;
  -
  -    /**
  -     * Axis constant
  -     */
  -    short AXIS_ATTRIBUTE = 4;
  -
  -    /**
  -     * Axis constant
  -     */
  -    short AXIS_SELF = 5;
  -
  -    /**
  -         * Axis constant
  -         */
  -    short AXIS_DESCENDANT_OR_SELF = 6;
  -
  -    /**
  -         * Axis constant
  -         */
  -    short AXIS_ANCESTOR = 7;
  -
  -    /**
  -         * Axis constant
  -         */
  -    short AXIS_FOLLOWING_SIBLING = 8;
  -
  -    /**
  -         * Axis constant
  -         */
  -    short AXIS_PRECEDING_SIBLING = 9;
  -
  -    /**
  -         * Axis constant
  -         */
  -    short AXIS_FOLLOWING = 10;
  -
  -    /**
  -         * Axis constant
  -         */
  -    short AXIS_PRECEDING = 11;
  -
  -    /**
  -         * Axis constant
  -         */
  -    short AXIS_NAMESPACE = 12;
  -
  -    /**
  -         * Axis constant
  -         */
  -    short AXIS_ANCESTOR_OR_SELF = 13;
  -
  -    /**
  -     *
  -     */
  -    boolean isForwardStep();
  -
  -    /**
  -     *
  -     */
  -    boolean isReversedStep();
  -
  -    /**
  -     * Tell whether this step is composed of a primary expression.
  -     */
  -    boolean isPrimaryExpr();
  -
  -    /**
  -     * Gets the type of step axis
  -    * @throws XPathException whenever the step is not a forward or reverse 
step.
  -     */
  -    short getAxisType() throws XPathException;
  -
  -    /**
  -     * Sets the type if step axis
  -     * @throws XPathException whenever the step is not a forward or reverse 
step.
  -     */
  -    void setAxisType(short newType) throws XPathException;
  -
  -    /**
  -     * Gets the name of step axis
  -    * @throws XPathException whenever the step is not a forward or reverse 
step.
  -     */
  -    String getAxisName() throws XPathException;
  -
  -    /**
  -     * Gets the node test
  -    * Note: there is a conflict in xalan implementation so temporaly change
  -    * the method definition here
  -     */
  -    NodeTest getStepNodeTest() throws XPathException;
  -
  -    /**
  -     * Gets the primary expression that composes this step
  -     * Note: there is a conflict in xalan implementation so temporaly change
  -     * the method definition here
  -     */
  -    Expr getPrimaryExpr() throws XPathException;
  -
  -    /**
  -     * Gets the predicate expression at the given position
  -     */
  -    Expr getPredicateAt(int i);
  -
  -    /**
  -     * Gets the number of predicate
  -     */
  -    int getPredicateCount();
  -
  -    /**
  -     * Append a predicate
  -     */
  -    void appendPredicate(Expr predicate);
  -
  -    /**
  -     * Remove the given predicate
  -     */
  -    void removePredicate(Expr predicate);
  -
  -    /**
  -     *
  -     */
  -    StepExpr cloneStep();
  -}
  +/*
  + * The Apache Software License, Version 1.1
  + *
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights
  + * reserved.
  + *
  + * Redistribution and use in source and binary forms, with or without
  + * modification, are permitted provided that the following conditions
  + * are met:
  + *
  + * 1. Redistributions of source code must retain the above copyright
  + *    notice, this list of conditions and the following disclaimer.
  + *
  + * 2. Redistributions in binary form must reproduce the above copyright
  + *    notice, this list of conditions and the following disclaimer in
  + *    the documentation and/or other materials provided with the
  + *    distribution.
  + *
  + * 3. The end-user documentation included with the redistribution,
  + *    if any, must include the following acknowledgment:
  + *       "This product includes software developed by the
  + *        Apache Software Foundation (http://www.apache.org/)."
  + *    Alternately, this acknowledgment may appear in the software itself,
  + *    if and wherever such third-party acknowledgments normally appear.
  + *
  + * 4. The names "Xalan" and "Apache Software Foundation" must
  + *    not be used to endorse or promote products derived from this
  + *    software without prior written permission. For written
  + *    permission, please contact [EMAIL PROTECTED]
  + *
  + * 5. Products derived from this software may not be called "Apache",
  + *    nor may "Apache" appear in their name, without prior written
  + *    permission of the Apache Software Foundation.
  + *
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  + * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  + * SUCH DAMAGE.
  + * ====================================================================
  + *
  + * This software consists of voluntary contributions made by many
  + * individuals on behalf of the Apache Software Foundation and was
  + * originally based on software copyright (c) 1999, Lotus
  + * Development Corporation., http://www.lotus.com.  For more
  + * information on the Apache Software Foundation, please see
  + * <http://www.apache.org/>.
  + */
  +package org.apache.xpath.rwapi.expression;
  +
  +import org.apache.xpath.rwapi.XPathException;
  +
  +
  +/**
  + * Represents a step expression.
  + * <pre>
  + * [20]   StepExpr   ::=   (ForwardStep |  ReverseStep |  Literal) Predicates
  + * [39]   ForwardStep   ::=   (ForwardAxis NodeTest) |  
AbbreviatedForwardStep
  + * [40]   ReverseStep   ::=   (ReverseAxis NodeTest) |  
AbbreviatedReverseStep
  + * </pre>
  + * @see <a href="http://www.w3.org/TR/xpath20/#id-axis-steps";>XPath 2.0 
specification</a>
  + */
  +public interface StepExpr extends Expr
  +{
  +    String[] FULL_AXIS_NAME = 
  +                              {
  +                                  "", "child", "descendant", "parent",
  +                                  "attribute", "self", "descendant-or-self",
  +                                  "ancestor", "following-sibling",
  +                                  "preceding-sibling", "following", 
"preceding",
  +                                  "namespace", "ancestor-or-self"
  +                              };
  +
  +    /**
  +     * Axis constant
  +     */
  +    short AXIS_CHILD = 1;
  +
  +    /**
  +     * Axis constant
  +     */
  +    short AXIS_DESCENDANT = 2;
  +
  +    /**
  +     * Axis constant
  +     */
  +    short AXIS_PARENT = 3;
  +
  +    /**
  +     * Axis constant
  +     */
  +    short AXIS_ATTRIBUTE = 4;
  +
  +    /**
  +     * Axis constant
  +     */
  +    short AXIS_SELF = 5;
  +
  +    /**
  +         * Axis constant
  +         */
  +    short AXIS_DESCENDANT_OR_SELF = 6;
  +
  +    /**
  +         * Axis constant
  +         */
  +    short AXIS_ANCESTOR = 7;
  +
  +    /**
  +         * Axis constant
  +         */
  +    short AXIS_FOLLOWING_SIBLING = 8;
  +
  +    /**
  +         * Axis constant
  +         */
  +    short AXIS_PRECEDING_SIBLING = 9;
  +
  +    /**
  +         * Axis constant
  +         */
  +    short AXIS_FOLLOWING = 10;
  +
  +    /**
  +         * Axis constant
  +         */
  +    short AXIS_PRECEDING = 11;
  +
  +    /**
  +         * Axis constant
  +         */
  +    short AXIS_NAMESPACE = 12;
  +
  +    /**
  +         * Axis constant
  +         */
  +    short AXIS_ANCESTOR_OR_SELF = 13;
  +
  +    /**
  +     *
  +     */
  +    boolean isForwardStep();
  +
  +    /**
  +     *
  +     */
  +    boolean isReversedStep();
  +
  +    /**
  +     * Tell whether this step is composed of a primary expression.
  +     */
  +    boolean isPrimaryExpr();
  +
  +    /**
  +     * Gets the type of step axis
  +    * @throws XPathException whenever the step is not a forward or reverse 
step.
  +     */
  +    short getAxisType() throws XPathException;
  +
  +    /**
  +     * Sets the type if step axis
  +     * @throws XPathException whenever the step is not a forward or reverse 
step.
  +     */
  +    void setAxisType(short newType) throws XPathException;
  +
  +    /**
  +     * Gets the name of step axis
  +    * @throws XPathException whenever the step is not a forward or reverse 
step.
  +     */
  +    String getAxisName() throws XPathException;
  +
  +    /**
  +     * Gets the node test
  +    * Note: there is a conflict in xalan implementation so temporaly change
  +    * the method definition here
  +     */
  +    NodeTest getStepNodeTest() throws XPathException;
  +
  +    /**
  +     * Gets the primary expression that composes this step
  +     * Note: there is a conflict in xalan implementation so temporaly change
  +     * the method definition here
  +     */
  +    Expr getPrimaryExpr() throws XPathException;
  +
  +    /**
  +     * Gets the predicate expression at the given position
  +     */
  +    Expr getPredicateAt(int i);
  +
  +    /**
  +     * Gets the number of predicate
  +     */
  +    int getPredicateCount();
  +
  +    /**
  +     * Append a predicate
  +     */
  +    void appendPredicate(Expr predicate);
  +
  +    /**
  +     * Remove the given predicate
  +     */
  +    void removePredicate(Expr predicate);
  +
  +    /**
  +     *
  +     */
  +    StepExpr cloneStep();
  +}
  
  
  
  1.1.2.3   +122 -122  
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/NodeTest.java
  
  Index: NodeTest.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/NodeTest.java,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- NodeTest.java     23 Jan 2003 19:36:49 -0000      1.1.2.2
  +++ NodeTest.java     30 Jan 2003 00:45:38 -0000      1.1.2.3
  @@ -1,122 +1,122 @@
  -/*
  - * The Apache Software License, Version 1.1
  - *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  - * reserved.
  - *
  - * Redistribution and use in source and binary forms, with or without
  - * modification, are permitted provided that the following conditions
  - * are met:
  - *
  - * 1. Redistributions of source code must retain the above copyright
  - *    notice, this list of conditions and the following disclaimer. 
  - *
  - * 2. Redistributions in binary form must reproduce the above copyright
  - *    notice, this list of conditions and the following disclaimer in
  - *    the documentation and/or other materials provided with the
  - *    distribution.
  - *
  - * 3. The end-user documentation included with the redistribution,
  - *    if any, must include the following acknowledgment:  
  - *       "This product includes software developed by the
  - *        Apache Software Foundation (http://www.apache.org/)."
  - *    Alternately, this acknowledgment may appear in the software itself,
  - *    if and wherever such third-party acknowledgments normally appear.
  - *
  - * 4. The names "Xalan" and "Apache Software Foundation" must
  - *    not be used to endorse or promote products derived from this
  - *    software without prior written permission. For written 
  - *    permission, please contact [EMAIL PROTECTED]
  - *
  - * 5. Products derived from this software may not be called "Apache",
  - *    nor may "Apache" appear in their name, without prior written
  - *    permission of the Apache Software Foundation.
  - *
  - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  - * SUCH DAMAGE.
  - * ====================================================================
  - *
  - * This software consists of voluntary contributions made by many
  - * individuals on behalf of the Apache Software Foundation and was
  - * originally based on software copyright (c) 1999, Lotus
  - * Development Corporation., http://www.lotus.com.  For more
  - * information on the Apache Software Foundation, please see
  - * <http://www.apache.org/>.
  - */
  -package org.apache.xpath.rwapi.expression;
  -
  -import org.apache.xpath.rwapi.*;
  -
  -/**
  - * Represents a node test
  - * <pre>
  - * [28]   NodeTest   ::=   KindTest |  NameTest 
  - * [29]   NameTest   ::=   QName |  Wildcard 
  - * [30]   Wildcard   ::=   "*" |  ":"? NCName ":" "*" |  "*" ":" NCName 
  - * [31]   KindTest   ::=   ProcessingInstructionTest 
  - *                          |  CommentTest
  - *                          |  TextTest
  - *                          |  AnyKindTest 
  - * [32]   ProcessingInstructionTest   ::=   "processing-instruction" "(" 
StringLiteral? ")" 
  - * [33]   CommentTest   ::=   "comment" "(" ")" 
  - * [34]   TextTest   ::=   "text" "(" ")" 
  - * [35]   AnyKindTest   ::=   "node" "(" ")"
  - * </pre>
  - * @see <a href="http://www.w3.org/TR/xpath20/#doc-NodeTest";>XPath 2.0 
specification</a>
  - */
  -public interface NodeTest extends Expr {
  -    
  -    String WILDCARD = "*";
  -    
  -    short PROCESSING_INSTRUCTION_TEST = 0;
  -    short COMMENT_TEST = 1;
  -    short ANY_KIND_TEST = 2;
  -    short TEXT_TEST = 3;
  -    
  -    String[] KIND_TEST_NAME = { "processing-instruction()", "comment()", 
"node()", "text()" };
  -    
  -    /**
  -     * Return true whenever this node test is a name test
  -     * @return boolean
  -     */
  -    boolean isNameTest();
  -    
  -    /**
  -     * Return true whenever this node test is a kind test
  -     * @return boolean
  -     */
  -    boolean isKindTest();
  -    
  -    /**
  -     * Gets the kind test
  -     * @return short One of the kind test constant value
  -     * @throws XPathException whenever this node test isn't a kind test
  -     */
  -    short getKindTest() throws XPathException; 
  -    
  -    /**
  -     * Gets the local part of the name test
  -     * @return String The local part of the name test or [EMAIL PROTECTED] 
#WILDCARD}
  -     * @throws XPathException whenever this node test isn't name test
  -     */
  -    String getLocalNameTest() throws XPathException;
  -    
  -    /**
  -     * Gets the prefix of the name test
  -     * @return String The prefix part of the name test or [EMAIL PROTECTED] 
#WILDCARD}
  -     * @throws XPathException whenever this node test isn't a name test
  -     */
  -    String getPrefix() throws XPathException;
  -}
  -
  -
  +/*
  + * The Apache Software License, Version 1.1
  + *
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights 
  + * reserved.
  + *
  + * Redistribution and use in source and binary forms, with or without
  + * modification, are permitted provided that the following conditions
  + * are met:
  + *
  + * 1. Redistributions of source code must retain the above copyright
  + *    notice, this list of conditions and the following disclaimer. 
  + *
  + * 2. Redistributions in binary form must reproduce the above copyright
  + *    notice, this list of conditions and the following disclaimer in
  + *    the documentation and/or other materials provided with the
  + *    distribution.
  + *
  + * 3. The end-user documentation included with the redistribution,
  + *    if any, must include the following acknowledgment:  
  + *       "This product includes software developed by the
  + *        Apache Software Foundation (http://www.apache.org/)."
  + *    Alternately, this acknowledgment may appear in the software itself,
  + *    if and wherever such third-party acknowledgments normally appear.
  + *
  + * 4. The names "Xalan" and "Apache Software Foundation" must
  + *    not be used to endorse or promote products derived from this
  + *    software without prior written permission. For written 
  + *    permission, please contact [EMAIL PROTECTED]
  + *
  + * 5. Products derived from this software may not be called "Apache",
  + *    nor may "Apache" appear in their name, without prior written
  + *    permission of the Apache Software Foundation.
  + *
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  + * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  + * SUCH DAMAGE.
  + * ====================================================================
  + *
  + * This software consists of voluntary contributions made by many
  + * individuals on behalf of the Apache Software Foundation and was
  + * originally based on software copyright (c) 1999, Lotus
  + * Development Corporation., http://www.lotus.com.  For more
  + * information on the Apache Software Foundation, please see
  + * <http://www.apache.org/>.
  + */
  +package org.apache.xpath.rwapi.expression;
  +
  +import org.apache.xpath.rwapi.*;
  +
  +/**
  + * Represents a node test
  + * <pre>
  + * [28]   NodeTest   ::=   KindTest |  NameTest 
  + * [29]   NameTest   ::=   QName |  Wildcard 
  + * [30]   Wildcard   ::=   "*" |  ":"? NCName ":" "*" |  "*" ":" NCName 
  + * [31]   KindTest   ::=   ProcessingInstructionTest 
  + *                          |  CommentTest
  + *                          |  TextTest
  + *                          |  AnyKindTest 
  + * [32]   ProcessingInstructionTest   ::=   "processing-instruction" "(" 
StringLiteral? ")" 
  + * [33]   CommentTest   ::=   "comment" "(" ")" 
  + * [34]   TextTest   ::=   "text" "(" ")" 
  + * [35]   AnyKindTest   ::=   "node" "(" ")"
  + * </pre>
  + * @see <a href="http://www.w3.org/TR/xpath20/#doc-NodeTest";>XPath 2.0 
specification</a>
  + */
  +public interface NodeTest extends Expr {
  +    
  +    String WILDCARD = "*";
  +    
  +    short PROCESSING_INSTRUCTION_TEST = 0;
  +    short COMMENT_TEST = 1;
  +    short ANY_KIND_TEST = 2;
  +    short TEXT_TEST = 3;
  +    
  +    String[] KIND_TEST_NAME = { "processing-instruction()", "comment()", 
"node()", "text()" };
  +    
  +    /**
  +     * Return true whenever this node test is a name test
  +     * @return boolean
  +     */
  +    boolean isNameTest();
  +    
  +    /**
  +     * Return true whenever this node test is a kind test
  +     * @return boolean
  +     */
  +    boolean isKindTest();
  +    
  +    /**
  +     * Gets the kind test
  +     * @return short One of the kind test constant value
  +     * @throws XPathException whenever this node test isn't a kind test
  +     */
  +    short getKindTest() throws XPathException; 
  +    
  +    /**
  +     * Gets the local part of the name test
  +     * @return String The local part of the name test or [EMAIL PROTECTED] 
#WILDCARD}
  +     * @throws XPathException whenever this node test isn't name test
  +     */
  +    String getLocalNameTest() throws XPathException;
  +    
  +    /**
  +     * Gets the prefix of the name test
  +     * @return String The prefix part of the name test or [EMAIL PROTECTED] 
#WILDCARD}
  +     * @throws XPathException whenever this node test isn't a name test
  +     */
  +    String getPrefix() throws XPathException;
  +}
  +
  +
  
  
  
  1.1.2.2   +1 -1      
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/ExpressionFactory.java
  
  Index: ExpressionFactory.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/ExpressionFactory.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- ExpressionFactory.java    13 Dec 2002 21:50:37 -0000      1.1.2.1
  +++ ExpressionFactory.java    30 Jan 2003 00:45:38 -0000      1.1.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  
  1.1.2.2   +1 -1      
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/ExprContext.java
  
  Index: ExprContext.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/ExprContext.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- ExprContext.java  13 Dec 2002 21:50:38 -0000      1.1.2.1
  +++ ExprContext.java  30 Jan 2003 00:45:38 -0000      1.1.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  
  1.1.2.2   +1 -1      
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/InstanceOfExpr.java
  
  Index: InstanceOfExpr.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/InstanceOfExpr.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- InstanceOfExpr.java       13 Dec 2002 21:50:38 -0000      1.1.2.1
  +++ InstanceOfExpr.java       30 Jan 2003 00:45:38 -0000      1.1.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  
  1.1.2.2   +1 -1      
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/OperatorExpr.java
  
  Index: OperatorExpr.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/OperatorExpr.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- OperatorExpr.java 13 Dec 2002 21:50:37 -0000      1.1.2.1
  +++ OperatorExpr.java 30 Jan 2003 00:45:38 -0000      1.1.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  
  1.1.2.2   +1 -1      
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/Visitable.java
  
  Index: Visitable.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/Visitable.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- Visitable.java    13 Dec 2002 21:50:38 -0000      1.1.2.1
  +++ Visitable.java    30 Jan 2003 00:45:38 -0000      1.1.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  
  1.1.2.3   +211 -211  
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/Expr.java
  
  Index: Expr.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/Expr.java,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- Expr.java 23 Jan 2003 19:36:49 -0000      1.1.2.2
  +++ Expr.java 30 Jan 2003 00:45:38 -0000      1.1.2.3
  @@ -1,211 +1,211 @@
  -/*
  - * The Apache Software License, Version 1.1
  - *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  - * reserved.
  - *
  - * Redistribution and use in source and binary forms, with or without
  - * modification, are permitted provided that the following conditions
  - * are met:
  - *
  - * 1. Redistributions of source code must retain the above copyright
  - *    notice, this list of conditions and the following disclaimer. 
  - *
  - * 2. Redistributions in binary form must reproduce the above copyright
  - *    notice, this list of conditions and the following disclaimer in
  - *    the documentation and/or other materials provided with the
  - *    distribution.
  - *
  - * 3. The end-user documentation included with the redistribution,
  - *    if any, must include the following acknowledgment:  
  - *       "This product includes software developed by the
  - *        Apache Software Foundation (http://www.apache.org/)."
  - *    Alternately, this acknowledgment may appear in the software itself,
  - *    if and wherever such third-party acknowledgments normally appear.
  - *
  - * 4. The names "Xalan" and "Apache Software Foundation" must
  - *    not be used to endorse or promote products derived from this
  - *    software without prior written permission. For written 
  - *    permission, please contact [EMAIL PROTECTED]
  - *
  - * 5. Products derived from this software may not be called "Apache",
  - *    nor may "Apache" appear in their name, without prior written
  - *    permission of the Apache Software Foundation.
  - *
  - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  - * SUCH DAMAGE.
  - * ====================================================================
  - *
  - * This software consists of voluntary contributions made by many
  - * individuals on behalf of the Apache Software Foundation and was
  - * originally based on software copyright (c) 1999, Lotus
  - * Development Corporation., http://www.lotus.com.  For more
  - * information on the Apache Software Foundation, please see
  - * <http://www.apache.org/>.
  - */
  -package org.apache.xpath.rwapi.expression;
  -
  -
  -/**
  - * This interface represents an XPath Expression.
  - * <pre>
  - * [1]   XPath   ::=   ExprSequence? 
  - * [3]   Expr    ::=   OrExpr
  - * [7]   QuantifiedExpr   ::=   ((<"some" "$"> |  <"every" "$">) VarName 
"in" Expr ("," "$" VarName "in" Expr)* "satisfies")* IfExpr
  - * [10]  ComparisonExpr   ::=   RangeExpr ( (ValueComp | GeneralComp |  
NodeComp | OrderComp)  RangeExpr )?
  - * [18]  PathExpr   ::=   ("/" RelativePathExpr?) |  ("//" RelativePathExpr) 
|  RelativePathExpr
  - * </pre>
  - * @see <a 
href="http://www.w3.org/TR/2002/WD-xpath20-20020816/#id-expressions";>XPath 2.0 
Specification</a>
  - */ 
  -public interface Expr extends Visitable {
  -
  -    /**
  -     * Path expression type
  -     */
  -    short PATH_EXPR = 0;
  -    
  -    /**
  -     * Logical expression type. 
  -     * Modelise 'or' and 'and' expressions
  -     */
  -    short LOGICAL_EXPR = 1;
  -    
  -    /**
  -     * Conditionnal expression type. 
  -     * Modelise 'if' expressions
  -     */
  -    short CONDITIONAL_EXPR = 2;
  -    
  -    /**
  -     * Iteration expression type.
  -     * Modelise 'for' expressions
  -     */
  -    short ITERATION_EXPR = 3;
  -    
  -    /**
  -     * Quantified expression type.
  -     * Modelise 'every' and 'some' expressions
  -     */
  -    short QUANTIFIED_EXPR = 4;
  -    
  -    /**
  -     * Comparison expression type. Modelise value comparisons, general
  -     * comparisons, node comparisons, and order comparisons.
  -     */
  -    short COMPARISON_EXPR = 5;
  -    
  -    /**
  -     * Arithmetic expression type.
  -     * Modelise arithmetic operators for addition, subtraction, 
multiplication, division, and modulus
  -     */
  -    short ARITHMETIC_EXPR = 6;
  -    
  -    /**
  -     * Sequence of expressions type.
  -     */
  -    short SEQUENCE_EXPR = 7;
  -    
  -    /**
  -     * Union and Intersection
  -     */
  -    short COMBINE_EXPR = 8;
  -    
  -    /**
  -     * 
  -     */
  -    short PRIMARY_EXPR = 9;
  -    
  -    /**
  -     * 
  -     */
  -    short VALIDATE_EXPR = 10;
  -    
  -    /**
  -     * 
  -     */
  -    short NAMETEST_EXPR = 11;
  -    
  -     /**
  -     * 
  -     */
  -    short KINDTEST_EXPR = 12;
  -    
  -
  -     /**
  -     * Literal primary expression type constant
  -     */
  -    short LITERAL_EXPR = 13;
  -
  -    /**
  -     * Function call primary expression type constant
  -     */
  -    short FUNCTION_CALL_EXPR = 14;
  -
  -    /**
  -     * Variable reference primary expression type constant
  -     */
  -    short VARIABLE_REF_EXPR = 15;
  -
  -    /**
  -     * Range expression type constant
  -     */
  -    short RANGE_EXPR = 16;
  -    
  -    /**
  -     * Step
  -     */
  -    short STEP = 17;
  -    
  -    /**
  -     * Instance of
  -     */
  -    short INSTANCE_OF_EXPR = 18;
  -    
  -     
  -    /**
  -     * Unary expression
  -     */
  -    short UNARY_EXPR = 19;
  -    
  -    /**
  -     * Cast expression
  -     */
  -    short CAST_EXPR = 20;
  -    
  -    /**
  -     * Castable expression
  -     */
  -    short CASTABLE_EXPR = 21;
  -
  -    /**
  -     * Gets the expression or expression component type
  -     * @return The type of this expression: one of the constants define in 
this class
  -     */
  -    short getExprType();
  -
  -    /**
  -     * Clone the expression
  -     * @return A clone of this expression
  -     */
  -    Expr cloneExpression();  
  -    
  -    /**
  -     * Gets the expression as a string (external form)
  -     * @param abbreviate Gets the string as an abbreviate form or not
  -     * @return The external form of this expression
  -     */
  -    String getString(boolean abbreviate);  
  -    
  -}
  -
  -
  +/*
  + * The Apache Software License, Version 1.1
  + *
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights 
  + * reserved.
  + *
  + * Redistribution and use in source and binary forms, with or without
  + * modification, are permitted provided that the following conditions
  + * are met:
  + *
  + * 1. Redistributions of source code must retain the above copyright
  + *    notice, this list of conditions and the following disclaimer. 
  + *
  + * 2. Redistributions in binary form must reproduce the above copyright
  + *    notice, this list of conditions and the following disclaimer in
  + *    the documentation and/or other materials provided with the
  + *    distribution.
  + *
  + * 3. The end-user documentation included with the redistribution,
  + *    if any, must include the following acknowledgment:  
  + *       "This product includes software developed by the
  + *        Apache Software Foundation (http://www.apache.org/)."
  + *    Alternately, this acknowledgment may appear in the software itself,
  + *    if and wherever such third-party acknowledgments normally appear.
  + *
  + * 4. The names "Xalan" and "Apache Software Foundation" must
  + *    not be used to endorse or promote products derived from this
  + *    software without prior written permission. For written 
  + *    permission, please contact [EMAIL PROTECTED]
  + *
  + * 5. Products derived from this software may not be called "Apache",
  + *    nor may "Apache" appear in their name, without prior written
  + *    permission of the Apache Software Foundation.
  + *
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  + * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  + * SUCH DAMAGE.
  + * ====================================================================
  + *
  + * This software consists of voluntary contributions made by many
  + * individuals on behalf of the Apache Software Foundation and was
  + * originally based on software copyright (c) 1999, Lotus
  + * Development Corporation., http://www.lotus.com.  For more
  + * information on the Apache Software Foundation, please see
  + * <http://www.apache.org/>.
  + */
  +package org.apache.xpath.rwapi.expression;
  +
  +
  +/**
  + * This interface represents an XPath Expression.
  + * <pre>
  + * [1]   XPath   ::=   ExprSequence? 
  + * [3]   Expr    ::=   OrExpr
  + * [7]   QuantifiedExpr   ::=   ((<"some" "$"> |  <"every" "$">) VarName 
"in" Expr ("," "$" VarName "in" Expr)* "satisfies")* IfExpr
  + * [10]  ComparisonExpr   ::=   RangeExpr ( (ValueComp | GeneralComp |  
NodeComp | OrderComp)  RangeExpr )?
  + * [18]  PathExpr   ::=   ("/" RelativePathExpr?) |  ("//" RelativePathExpr) 
|  RelativePathExpr
  + * </pre>
  + * @see <a 
href="http://www.w3.org/TR/2002/WD-xpath20-20020816/#id-expressions";>XPath 2.0 
Specification</a>
  + */ 
  +public interface Expr extends Visitable {
  +
  +    /**
  +     * Path expression type
  +     */
  +    short PATH_EXPR = 0;
  +    
  +    /**
  +     * Logical expression type. 
  +     * Modelise 'or' and 'and' expressions
  +     */
  +    short LOGICAL_EXPR = 1;
  +    
  +    /**
  +     * Conditionnal expression type. 
  +     * Modelise 'if' expressions
  +     */
  +    short CONDITIONAL_EXPR = 2;
  +    
  +    /**
  +     * Iteration expression type.
  +     * Modelise 'for' expressions
  +     */
  +    short ITERATION_EXPR = 3;
  +    
  +    /**
  +     * Quantified expression type.
  +     * Modelise 'every' and 'some' expressions
  +     */
  +    short QUANTIFIED_EXPR = 4;
  +    
  +    /**
  +     * Comparison expression type. Modelise value comparisons, general
  +     * comparisons, node comparisons, and order comparisons.
  +     */
  +    short COMPARISON_EXPR = 5;
  +    
  +    /**
  +     * Arithmetic expression type.
  +     * Modelise arithmetic operators for addition, subtraction, 
multiplication, division, and modulus
  +     */
  +    short ARITHMETIC_EXPR = 6;
  +    
  +    /**
  +     * Sequence of expressions type.
  +     */
  +    short SEQUENCE_EXPR = 7;
  +    
  +    /**
  +     * Union and Intersection
  +     */
  +    short COMBINE_EXPR = 8;
  +    
  +    /**
  +     * 
  +     */
  +    short PRIMARY_EXPR = 9;
  +    
  +    /**
  +     * 
  +     */
  +    short VALIDATE_EXPR = 10;
  +    
  +    /**
  +     * 
  +     */
  +    short NAMETEST_EXPR = 11;
  +    
  +     /**
  +     * 
  +     */
  +    short KINDTEST_EXPR = 12;
  +    
  +
  +     /**
  +     * Literal primary expression type constant
  +     */
  +    short LITERAL_EXPR = 13;
  +
  +    /**
  +     * Function call primary expression type constant
  +     */
  +    short FUNCTION_CALL_EXPR = 14;
  +
  +    /**
  +     * Variable reference primary expression type constant
  +     */
  +    short VARIABLE_REF_EXPR = 15;
  +
  +    /**
  +     * Range expression type constant
  +     */
  +    short RANGE_EXPR = 16;
  +    
  +    /**
  +     * Step
  +     */
  +    short STEP = 17;
  +    
  +    /**
  +     * Instance of
  +     */
  +    short INSTANCE_OF_EXPR = 18;
  +    
  +     
  +    /**
  +     * Unary expression
  +     */
  +    short UNARY_EXPR = 19;
  +    
  +    /**
  +     * Cast expression
  +     */
  +    short CAST_EXPR = 20;
  +    
  +    /**
  +     * Castable expression
  +     */
  +    short CASTABLE_EXPR = 21;
  +
  +    /**
  +     * Gets the expression or expression component type
  +     * @return The type of this expression: one of the constants define in 
this class
  +     */
  +    short getExprType();
  +
  +    /**
  +     * Clone the expression
  +     * @return A clone of this expression
  +     */
  +    Expr cloneExpression();  
  +    
  +    /**
  +     * Gets the expression as a string (external form)
  +     * @param abbreviate Gets the string as an abbreviate form or not
  +     * @return The external form of this expression
  +     */
  +    String getString(boolean abbreviate);  
  +    
  +}
  +
  +
  
  
  
  1.1.2.2   +1 -1      
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/FunctionCall.java
  
  Index: FunctionCall.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/FunctionCall.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- FunctionCall.java 13 Dec 2002 21:50:37 -0000      1.1.2.1
  +++ FunctionCall.java 30 Jan 2003 00:45:38 -0000      1.1.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  
  1.1.2.2   +1 -1      
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/CastExpr.java
  
  Index: CastExpr.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/CastExpr.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- CastExpr.java     13 Dec 2002 21:50:37 -0000      1.1.2.1
  +++ CastExpr.java     30 Jan 2003 00:45:38 -0000      1.1.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  
  1.1.2.2   +1 -1      
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/Literal.java
  
  Index: Literal.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/Literal.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- Literal.java      13 Dec 2002 21:50:37 -0000      1.1.2.1
  +++ Literal.java      30 Jan 2003 00:45:38 -0000      1.1.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  
  1.1.2.2   +1 -1      
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/PathExpr.java
  
  Index: PathExpr.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/PathExpr.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- PathExpr.java     13 Dec 2002 21:50:38 -0000      1.1.2.1
  +++ PathExpr.java     30 Jan 2003 00:45:38 -0000      1.1.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  
  1.1.2.2   +1 -1      
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/Variable.java
  
  Index: Variable.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/Variable.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- Variable.java     13 Dec 2002 21:50:37 -0000      1.1.2.1
  +++ Variable.java     30 Jan 2003 00:45:38 -0000      1.1.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  
  1.1.2.2   +1 -1      
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/ConditionalExpr.java
  
  Index: ConditionalExpr.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/ConditionalExpr.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- ConditionalExpr.java      13 Dec 2002 21:50:38 -0000      1.1.2.1
  +++ ConditionalExpr.java      30 Jan 2003 00:45:38 -0000      1.1.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  
  1.1.2.2   +1 -1      
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/Visitor.java
  
  Index: Visitor.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/Visitor.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- Visitor.java      13 Dec 2002 21:50:37 -0000      1.1.2.1
  +++ Visitor.java      30 Jan 2003 00:45:38 -0000      1.1.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  
  1.1.2.2   +1 -1      
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/ForAndQuantifiedExpr.java
  
  Index: ForAndQuantifiedExpr.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/ForAndQuantifiedExpr.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- ForAndQuantifiedExpr.java 13 Dec 2002 21:50:37 -0000      1.1.2.1
  +++ ForAndQuantifiedExpr.java 30 Jan 2003 00:45:38 -0000      1.1.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  
  1.1.2.2   +1 -1      
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/CastableExpr.java
  
  Index: CastableExpr.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/CastableExpr.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- CastableExpr.java 13 Dec 2002 21:50:38 -0000      1.1.2.1
  +++ CastableExpr.java 30 Jan 2003 00:45:38 -0000      1.1.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  
  1.1.2.2   +1 -1      
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/StaticContext.java
  
  Index: StaticContext.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/StaticContext.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- StaticContext.java        13 Dec 2002 21:50:37 -0000      1.1.2.1
  +++ StaticContext.java        30 Jan 2003 00:45:38 -0000      1.1.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.2   +1 -1      
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/datamodel/Attic/Sequence.java
  
  Index: Sequence.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/datamodel/Attic/Sequence.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- Sequence.java     13 Dec 2002 21:50:41 -0000      1.1.2.1
  +++ Sequence.java     30 Jan 2003 00:45:40 -0000      1.1.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  
  1.1.2.2   +1 -1      
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/datamodel/Attic/SingleType.java
  
  Index: SingleType.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/datamodel/Attic/SingleType.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- SingleType.java   13 Dec 2002 21:50:41 -0000      1.1.2.1
  +++ SingleType.java   30 Jan 2003 00:45:40 -0000      1.1.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  
  1.1.2.2   +1 -1      
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/datamodel/Attic/Node.java
  
  Index: Node.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/datamodel/Attic/Node.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- Node.java 13 Dec 2002 21:50:41 -0000      1.1.2.1
  +++ Node.java 30 Jan 2003 00:45:40 -0000      1.1.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  
  1.1.2.2   +1 -1      
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/datamodel/Attic/Item.java
  
  Index: Item.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/datamodel/Attic/Item.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- Item.java 13 Dec 2002 21:50:41 -0000      1.1.2.1
  +++ Item.java 30 Jan 2003 00:45:40 -0000      1.1.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  
  1.1.2.2   +1 -1      
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/datamodel/Attic/SequenceType.java
  
  Index: SequenceType.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/datamodel/Attic/SequenceType.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- SequenceType.java 13 Dec 2002 21:50:41 -0000      1.1.2.1
  +++ SequenceType.java 30 Jan 2003 00:45:40 -0000      1.1.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  
  1.1.2.2   +1 -1      
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/datamodel/Attic/ItemFactory.java
  
  Index: ItemFactory.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/datamodel/Attic/ItemFactory.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- ItemFactory.java  13 Dec 2002 21:50:41 -0000      1.1.2.1
  +++ ItemFactory.java  30 Jan 2003 00:45:40 -0000      1.1.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  
  1.1.2.2   +1 -1      
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/datamodel/Attic/AtomicValue.java
  
  Index: AtomicValue.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/datamodel/Attic/AtomicValue.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- AtomicValue.java  13 Dec 2002 21:50:41 -0000      1.1.2.1
  +++ AtomicValue.java  30 Jan 2003 00:45:40 -0000      1.1.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.2   +1 -1      
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/parser/Attic/XPath2Node.java
  
  Index: XPath2Node.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/parser/Attic/XPath2Node.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- XPath2Node.java   13 Dec 2002 21:50:40 -0000      1.1.2.1
  +++ XPath2Node.java   30 Jan 2003 00:45:41 -0000      1.1.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  
  1.1.2.3   +140 -140  
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/parser/Attic/Singletons.java
  
  Index: Singletons.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/parser/Attic/Singletons.java,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- Singletons.java   23 Jan 2003 19:36:50 -0000      1.1.2.2
  +++ Singletons.java   30 Jan 2003 00:45:41 -0000      1.1.2.3
  @@ -1,140 +1,140 @@
  -/*
  - * The Apache Software License, Version 1.1
  - *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights
  - * reserved.
  - *
  - * Redistribution and use in source and binary forms, with or without
  - * modification, are permitted provided that the following conditions
  - * are met:
  - *
  - * 1. Redistributions of source code must retain the above copyright
  - *    notice, this list of conditions and the following disclaimer.
  - *
  - * 2. Redistributions in binary form must reproduce the above copyright
  - *    notice, this list of conditions and the following disclaimer in
  - *    the documentation and/or other materials provided with the
  - *    distribution.
  - *
  - * 3. The end-user documentation included with the redistribution,
  - *    if any, must include the following acknowledgment:
  - *       "This product includes software developed by the
  - *        Apache Software Foundation (http://www.apache.org/)."
  - *    Alternately, this acknowledgment may appear in the software itself,
  - *    if and wherever such third-party acknowledgments normally appear.
  - *
  - * 4. The names "Xalan" and "Apache Software Foundation" must
  - *    not be used to endorse or promote products derived from this
  - *    software without prior written permission. For written
  - *    permission, please contact [EMAIL PROTECTED]
  - *
  - * 5. Products derived from this software may not be called "Apache",
  - *    nor may "Apache" appear in their name, without prior written
  - *    permission of the Apache Software Foundation.
  - *
  - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  - * SUCH DAMAGE.
  - * ====================================================================
  - *
  - * This software consists of voluntary contributions made by many
  - * individuals on behalf of the Apache Software Foundation and was
  - * originally based on software copyright (c) 1999, Lotus
  - * Development Corporation., http://www.lotus.com.  For more
  - * information on the Apache Software Foundation, please see
  - * <http://www.apache.org/>.
  - */
  -package org.apache.xpath.rwapi.impl.parser;
  -
  -import org.apache.xpath.rwapi.expression.NodeTest;
  -import org.apache.xpath.rwapi.expression.StepExpr;
  -import org.apache.xpath.rwapi.impl.KindTestImpl;
  -import org.apache.xpath.rwapi.impl.StepExprImpl;
  -
  -
  -/**
  - *
  - */
  -public class Singletons extends SimpleNode
  -{
  -    /**
  -     * DotDot singleton
  -     */
  -    static final protected Singletons DOTDOT = new 
Singletons(XPathTreeConstants.JJTDOTDOT);
  -
  -    /**
  -     * Slash singleton
  -     */
  -    static final protected Singletons SLASH = new 
Singletons(XPathTreeConstants.JJTSLASH);
  -
  -    /**
  -    * At singleton
  -    */
  -    static final protected Singletons AT = new 
Singletons(XPathTreeConstants.JJTAT);
  -
  -    /**
  -     * NodeTest singleton
  -     */
  -    static final protected Singletons NODETEST = new 
Singletons(XPathTreeConstants.JJTNODETEST);
  -
  -    /**
  -     * Root singleton
  -     */
  -    static final protected Singletons ROOT = new 
Singletons(XPathTreeConstants.JJTROOT);
  -
  -    /**
  -     * Root descendants singleton
  -     */
  -    static final protected Singletons ROOTDESCENDANT = new 
Singletons(XPathTreeConstants.JJTROOTDESCENDANTS);
  -
  -    /**
  -     * Minus singleton
  -     */
  -    static final protected Singletons MINUS = new 
Singletons(XPathTreeConstants.JJTMINUS);
  -
  -    /**
  -             * Plus singleton
  -             */
  -    static final protected Singletons PLUS = new 
Singletons(XPathTreeConstants.JJTPLUS);
  -
  -    /**
  -     * SlashSlash singleton
  -     */
  -    static final public StepExprImpl SLASHSLASH;
  -
  -    static
  -    {
  -        KindTestImpl kt = new KindTestImpl();
  -        kt.setKindTest(NodeTest.ANY_KIND_TEST);
  -
  -        SLASHSLASH = new StepExprImpl(StepExpr.AXIS_DESCENDANT_OR_SELF, kt);
  -    }
  -
  -    /**
  -     * Constructor for Singletons.
  -     * @param i
  -     */
  -    private Singletons(int i)
  -    {
  -        super(i);
  -    }
  -
  -    /**
  -     * Constructor for Singletons.
  -     * @param p
  -     * @param i
  -     */
  -    private Singletons(XPath p, int i)
  -    {
  -        super(p, i);
  -    }
  -}
  +/*
  + * The Apache Software License, Version 1.1
  + *
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights
  + * reserved.
  + *
  + * Redistribution and use in source and binary forms, with or without
  + * modification, are permitted provided that the following conditions
  + * are met:
  + *
  + * 1. Redistributions of source code must retain the above copyright
  + *    notice, this list of conditions and the following disclaimer.
  + *
  + * 2. Redistributions in binary form must reproduce the above copyright
  + *    notice, this list of conditions and the following disclaimer in
  + *    the documentation and/or other materials provided with the
  + *    distribution.
  + *
  + * 3. The end-user documentation included with the redistribution,
  + *    if any, must include the following acknowledgment:
  + *       "This product includes software developed by the
  + *        Apache Software Foundation (http://www.apache.org/)."
  + *    Alternately, this acknowledgment may appear in the software itself,
  + *    if and wherever such third-party acknowledgments normally appear.
  + *
  + * 4. The names "Xalan" and "Apache Software Foundation" must
  + *    not be used to endorse or promote products derived from this
  + *    software without prior written permission. For written
  + *    permission, please contact [EMAIL PROTECTED]
  + *
  + * 5. Products derived from this software may not be called "Apache",
  + *    nor may "Apache" appear in their name, without prior written
  + *    permission of the Apache Software Foundation.
  + *
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  + * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  + * SUCH DAMAGE.
  + * ====================================================================
  + *
  + * This software consists of voluntary contributions made by many
  + * individuals on behalf of the Apache Software Foundation and was
  + * originally based on software copyright (c) 1999, Lotus
  + * Development Corporation., http://www.lotus.com.  For more
  + * information on the Apache Software Foundation, please see
  + * <http://www.apache.org/>.
  + */
  +package org.apache.xpath.rwapi.impl.parser;
  +
  +import org.apache.xpath.rwapi.expression.NodeTest;
  +import org.apache.xpath.rwapi.expression.StepExpr;
  +import org.apache.xpath.rwapi.impl.KindTestImpl;
  +import org.apache.xpath.rwapi.impl.StepExprImpl;
  +
  +
  +/**
  + *
  + */
  +public class Singletons extends SimpleNode
  +{
  +    /**
  +     * DotDot singleton
  +     */
  +    static final protected Singletons DOTDOT = new 
Singletons(XPathTreeConstants.JJTDOTDOT);
  +
  +    /**
  +     * Slash singleton
  +     */
  +    static final protected Singletons SLASH = new 
Singletons(XPathTreeConstants.JJTSLASH);
  +
  +    /**
  +    * At singleton
  +    */
  +    static final protected Singletons AT = new 
Singletons(XPathTreeConstants.JJTAT);
  +
  +    /**
  +     * NodeTest singleton
  +     */
  +    static final protected Singletons NODETEST = new 
Singletons(XPathTreeConstants.JJTNODETEST);
  +
  +    /**
  +     * Root singleton
  +     */
  +    static final protected Singletons ROOT = new 
Singletons(XPathTreeConstants.JJTROOT);
  +
  +    /**
  +     * Root descendants singleton
  +     */
  +    static final protected Singletons ROOTDESCENDANT = new 
Singletons(XPathTreeConstants.JJTROOTDESCENDANTS);
  +
  +    /**
  +     * Minus singleton
  +     */
  +    static final protected Singletons MINUS = new 
Singletons(XPathTreeConstants.JJTMINUS);
  +
  +    /**
  +             * Plus singleton
  +             */
  +    static final protected Singletons PLUS = new 
Singletons(XPathTreeConstants.JJTPLUS);
  +
  +    /**
  +     * SlashSlash singleton
  +     */
  +    static final public StepExprImpl SLASHSLASH;
  +
  +    static
  +    {
  +        KindTestImpl kt = new KindTestImpl();
  +        kt.setKindTest(NodeTest.ANY_KIND_TEST);
  +
  +        SLASHSLASH = new StepExprImpl(StepExpr.AXIS_DESCENDANT_OR_SELF, kt);
  +    }
  +
  +    /**
  +     * Constructor for Singletons.
  +     * @param i
  +     */
  +    private Singletons(int i)
  +    {
  +        super(i);
  +    }
  +
  +    /**
  +     * Constructor for Singletons.
  +     * @param p
  +     * @param i
  +     */
  +    private Singletons(XPath p, int i)
  +    {
  +        super(p, i);
  +    }
  +}
  
  
  
  1.1.2.2   +1 -1      
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/parser/Attic/Axis.java
  
  Index: Axis.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/parser/Attic/Axis.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- Axis.java 13 Dec 2002 21:50:40 -0000      1.1.2.1
  +++ Axis.java 30 Jan 2003 00:45:41 -0000      1.1.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  
  1.1.2.2   +1 -1      
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/parser/Attic/KindTest.java
  
  Index: KindTest.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/parser/Attic/KindTest.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- KindTest.java     13 Dec 2002 21:50:40 -0000      1.1.2.1
  +++ KindTest.java     30 Jan 2003 00:45:41 -0000      1.1.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  
  1.1.2.2   +1 -1      
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/parser/Attic/Predicates.java
  
  Index: Predicates.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/parser/Attic/Predicates.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- Predicates.java   13 Dec 2002 21:50:40 -0000      1.1.2.1
  +++ Predicates.java   30 Jan 2003 00:45:41 -0000      1.1.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  
  1.1.2.2   +1 -1      
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/parser/Attic/QName.java
  
  Index: QName.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/parser/Attic/QName.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- QName.java        13 Dec 2002 21:50:40 -0000      1.1.2.1
  +++ QName.java        30 Jan 2003 00:45:41 -0000      1.1.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  
  1.1.2.2   +1 -1      
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/parser/Attic/XPathNode.java
  
  Index: XPathNode.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/parser/Attic/XPathNode.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- XPathNode.java    13 Dec 2002 21:50:40 -0000      1.1.2.1
  +++ XPathNode.java    30 Jan 2003 00:45:41 -0000      1.1.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.2   +1 -1      
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/Attic/XPathException.java
  
  Index: XPathException.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/Attic/XPathException.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- XPathException.java       13 Dec 2002 21:50:46 -0000      1.1.2.1
  +++ XPathException.java       30 Jan 2003 00:45:41 -0000      1.1.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  
  1.1.2.2   +1 -1      
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/Attic/XPathFactory.java
  
  Index: XPathFactory.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/Attic/XPathFactory.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- XPathFactory.java 13 Dec 2002 21:50:46 -0000      1.1.2.1
  +++ XPathFactory.java 30 Jan 2003 00:45:41 -0000      1.1.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.2   +1 -1      
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/eval/Attic/Evaluator.java
  
  Index: Evaluator.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/eval/Attic/Evaluator.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- Evaluator.java    13 Dec 2002 21:50:46 -0000      1.1.2.1
  +++ Evaluator.java    30 Jan 2003 00:45:41 -0000      1.1.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  
  1.1.2.2   +1 -1      
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/eval/Attic/NamespaceContext.java
  
  Index: NamespaceContext.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/eval/Attic/NamespaceContext.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- NamespaceContext.java     13 Dec 2002 21:50:46 -0000      1.1.2.1
  +++ NamespaceContext.java     30 Jan 2003 00:45:41 -0000      1.1.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  
  1.1.2.2   +1 -1      
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/eval/Attic/EvaluatorFactory.java
  
  Index: EvaluatorFactory.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/eval/Attic/EvaluatorFactory.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- EvaluatorFactory.java     13 Dec 2002 21:50:46 -0000      1.1.2.1
  +++ EvaluatorFactory.java     30 Jan 2003 00:45:42 -0000      1.1.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  
  1.1.2.2   +1 -1      
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/eval/Attic/DynamicContext.java
  
  Index: DynamicContext.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/eval/Attic/DynamicContext.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- DynamicContext.java       13 Dec 2002 21:50:46 -0000      1.1.2.1
  +++ DynamicContext.java       30 Jan 2003 00:45:42 -0000      1.1.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.3   +378 -378  
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/test/Attic/Test.java
  
  Index: Test.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/test/Attic/Test.java,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- Test.java 23 Jan 2003 19:36:54 -0000      1.1.2.2
  +++ Test.java 30 Jan 2003 00:45:42 -0000      1.1.2.3
  @@ -1,378 +1,378 @@
  -/*
  - * The Apache Software License, Version 1.1
  - *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights
  - * reserved.
  - *
  - * Redistribution and use in source and binary forms, with or without
  - * modification, are permitted provided that the following conditions
  - * are met:
  - *
  - * 1. Redistributions of source code must retain the above copyright
  - *    notice, this list of conditions and the following disclaimer.
  - *
  - * 2. Redistributions in binary form must reproduce the above copyright
  - *    notice, this list of conditions and the following disclaimer in
  - *    the documentation and/or other materials provided with the
  - *    distribution.
  - *
  - * 3. The end-user documentation included with the redistribution,
  - *    if any, must include the following acknowledgment:
  - *       "This product includes software developed by the
  - *        Apache Software Foundation (http://www.apache.org/)."
  - *    Alternately, this acknowledgment may appear in the software itself,
  - *    if and wherever such third-party acknowledgments normally appear.
  - *
  - * 4. The names "Xalan" and "Apache Software Foundation" must
  - *    not be used to endorse or promote products derived from this
  - *    software without prior written permission. For written
  - *    permission, please contact [EMAIL PROTECTED]
  - *
  - * 5. Products derived from this software may not be called "Apache",
  - *    nor may "Apache" appear in their name, without prior written
  - *    permission of the Apache Software Foundation.
  - *
  - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  - * SUCH DAMAGE.
  - * ====================================================================
  - *
  - * This software consists of voluntary contributions made by many
  - * individuals on behalf of the Apache Software Foundation and was
  - * originally based on software copyright (c) 1999, Lotus
  - * Development Corporation., http://www.lotus.com.  For more
  - * information on the Apache Software Foundation, please see
  - * <http://www.apache.org/>.
  - */
  -package org.apache.xpath.rwapi.test;
  -
  -import org.apache.xpath.objects.XObject;
  -import org.apache.xpath.rwapi.XPathFactory;
  -import org.apache.xpath.rwapi.eval.Evaluator;
  -import org.apache.xpath.rwapi.expression.ConditionalExpr;
  -import org.apache.xpath.rwapi.expression.Expr;
  -import org.apache.xpath.rwapi.expression.ExprContext;
  -import org.apache.xpath.rwapi.expression.ExpressionFactory;
  -import org.apache.xpath.rwapi.expression.ForAndQuantifiedExpr;
  -import org.apache.xpath.rwapi.expression.Literal;
  -import org.apache.xpath.rwapi.expression.NodeTest;
  -import org.apache.xpath.rwapi.expression.OperatorExpr;
  -import org.apache.xpath.rwapi.expression.PathExpr;
  -import org.apache.xpath.rwapi.expression.StepExpr;
  -import org.apache.xpath.rwapi.expression.Variable;
  -import org.apache.xpath.rwapi.expression.Visitor;
  -import org.apache.xpath.rwapi.impl.parser.SimpleNode;
  -import org.apache.xpath.rwapi.impl.parser.XPath;
  -import org.apache.xpath.rwapi.impl.parser.XPathTreeConstants;
  -
  -import org.w3c.dom.Document;
  -import org.w3c.dom.Element;
  -import org.w3c.dom.Node;
  -import org.w3c.dom.NodeList;
  -
  -import java.io.StringReader;
  -
  -import javax.xml.parsers.DocumentBuilder;
  -import javax.xml.parsers.DocumentBuilderFactory;
  -
  -
  -/**
  - * Title:
  - * Description:
  - * Copyright:    Copyright (c) 2001
  - * Company:
  - * @author
  - * @version 1.0
  - */
  -public class Test
  -{
  -    public Test(String[] args)
  -    {
  -        try
  -        {
  -            final boolean dumpTree = ((args.length == 1)
  -                && args[0].equals("-dump")) ? true : false;
  -
  -            /*if(args[0].endsWith(".xquery"))
  -            {
  -              System.out.println("Running test for: "+args[0]);
  -              File file = new File(args[0]);
  -              FileInputStream fis = new FileInputStream(file);
  -              XPath parser = new XPath(fis);
  -              SimpleNode tree = parser.XPath2();
  -              if(dumpTree)
  -                tree.dump("|") ;
  -            }
  -            else
  -            {*/
  -            DocumentBuilderFactory dbf = 
DocumentBuilderFactory.newInstance();
  -            DocumentBuilder db = dbf.newDocumentBuilder();
  -            Document doc = db.parse(ClassLoader.getSystemResourceAsStream(
  -                        "org/apache/xpath/rwapi/test/xpathsamples.xml"));
  -            doc.normalize();
  -
  -            Element tests = doc.getDocumentElement();
  -            NodeList testElems = tests.getChildNodes();
  -            int nChildren = testElems.getLength();
  -            int testid = 0;
  -            boolean testSuccess = true;
  -
  -            for (int i = 0; i < nChildren; i++)
  -            {
  -                org.w3c.dom.Node node = testElems.item(i);
  -
  -                if (org.w3c.dom.Node.ELEMENT_NODE == node.getNodeType())
  -                {
  -                    testid++;
  -
  -                    String xpathString = ((Element) 
node).getAttribute("value");
  -                    System.out.println("Test[" + testid + "]: " + 
xpathString);
  -
  -                    XPath parser = new XPath(new StringReader(xpathString));
  -                    SimpleNode tree = parser.XPath2();
  -
  -                    if (SimpleNode.PRODUCE_RAW_TREE)
  -                    {
  -                        if (dumpTree)
  -                        {
  -                            tree.dump("|");
  -                        }
  -                    }
  -                    else
  -                    {
  -                        Expr expr = (Expr) tree.jjtGetChild(0);
  -
  -                        // Gets the reference AST to compare with
  -                        NodeList astNodes = ((Element) node)
  -                            .getElementsByTagName("ast");
  -
  -                        if ((astNodes != null) && (astNodes.getLength() >= 
1))
  -                        {
  -                            Node astNode = astNodes.item(0);
  -
  -                            if (!checkAST((SimpleNode) expr,
  -                                        (Element) ((Element) 
astNode).getElementsByTagName(
  -                                            "node").item(0)))
  -                            {
  -                                System.err.println(
  -                                    "Generated AST doesn't match the 
reference one");
  -
  -                                tree.dump("|");
  -                            }
  -                        }
  -                        else
  -                        {
  -                            System.err.println("No reference AST provided");
  -                        }
  -
  -                        String ab = expr.getString(true);
  -
  -                        //System.out.println(
  -                        //   "Parsed expr (abbreviate form):" + ab);
  -                        //System.out.println(
  -                        //   "Parsed expr (non-abbreviate form):"
  -                        //           + expr.getString(false));
  -                        if (!ab.equals(xpathString))
  -                        {
  -                            System.err.print(
  -                                "Bad external or internal representation: ");
  -                            System.err.println(ab + "  !=  " + xpathString);
  -                            testSuccess = false;
  -                        }
  -                    }
  -                }
  -            }
  -
  -            // }
  -            if (testSuccess)
  -            {
  -                System.out.println("Parsing test successful!!!");
  -            }
  -            else
  -            {
  -                System.out.println("Parsing Test fails!!!!!!!!!");
  -            }
  -
  -            // Test creation
  -            ExpressionFactory exprFct = XPathFactory.newInstance()
  -                                                    .newExpressionFactory();
  -
  -            Expr expr = exprFct.createExpr("child::tutu[10]");
  -            System.out.println("tutu[10] =? " + expr.getString(true));
  -
  -            PathExpr pathExpr = exprFct.createPathExpr(true);
  -            System.out.println("/ =? " + pathExpr.getString(true));
  -
  -            NodeTest nt = exprFct.createNameTest(null, "toto");
  -            pathExpr.addOperand(exprFct.createStepExpr(StepExpr.AXIS_CHILD, 
nt));
  -            System.out.println("/toto =? " + pathExpr.getString(true));
  -            System.out.println("/child::toto =? " + 
pathExpr.getString(false));
  -
  -            nt = exprFct.createNameTest(null, "titi");
  -            pathExpr.addOperand(exprFct.createStepExpr(
  -                    StepExpr.AXIS_DESCENDANT, nt));
  -
  -            System.out.println("/toto/descendant::titi =? "
  -                + pathExpr.getString(true));
  -            System.out.println("/child::toto/descendant::titi =? "
  -                + pathExpr.getString(false));
  -
  -            StepExpr se = (StepExpr) pathExpr.getOperand(0); // first step
  -            se.appendPredicate(exprFct.createIntegerLiteralExpr(50));
  -            System.out.println("/toto[50]/descendant::titi =? "
  -                + pathExpr.getString(true));
  -            System.out.println("/child::toto[50]/descendant::titi =? "
  -                + pathExpr.getString(false));
  -
  -            // Test visitor
  -            pathExpr.visit(new Visitor()
  -                {
  -                    /**
  -                    *
  -                    */
  -                    public boolean visitPath(PathExpr path)
  -                    {
  -                        System.out.println("visit path "
  -                            + path.getString(false));
  -
  -                        return true;
  -                    }
  -
  -                    /**
  -                     *
  -                     */
  -                    public boolean visitStep(StepExpr step)
  -                    {
  -                        System.out.println("visit step "
  -                            + step.getString(false));
  -
  -                        return true;
  -                    }
  -
  -                    /**
  -                     *
  -                     */
  -                    public boolean visitLiteral(Literal primary)
  -                    {
  -                        System.out.println(primary.getString(false));
  -
  -                        return true;
  -                    }
  -
  -                    /**
  -                     *
  -                     */
  -                    public boolean visitOperator(OperatorExpr arithmetic)
  -                    {
  -                        System.out.println(arithmetic.getString(false));
  -
  -                        return true;
  -                    }
  -
  -                    /**
  -                     *
  -                     */
  -                    public boolean visitConditional(ConditionalExpr 
condition)
  -                    {
  -                        System.out.println(condition.getString(false));
  -
  -                        return true;
  -                    }
  -
  -                    /**
  -                     *
  -                     */
  -                    public boolean visitForOrQuantifiedExpr(
  -                        ForAndQuantifiedExpr expr)
  -                    {
  -                        System.out.println(expr.getString(false));
  -
  -                        return true;
  -                    }
  -
  -                    /**
  -                     *
  -                     */
  -                    public boolean visitVariable(Variable var)
  -                    {
  -                        return false;
  -                    }
  -                });
  -
  -            // Evaluation
  -            Evaluator eval = XPathFactory.newInstance().newEvaluatorFactory()
  -                                         .createEvaluator();
  -
  -            ExprContext ctx = eval.createExprContext();
  -            ctx.getDynamicContext().setContextItem(doc.getDocumentElement());
  -
  -            // exprs
  -            Expr e = exprFct.createExpr("expr[2]/@value");
  -            Object res = eval.evaluate(ctx, e);
  -
  -            // Xalan dependent code
  -            System.out.println("10[$var] ?= " + ((XObject) res).str());
  -        }
  -        catch (Exception e)
  -        {
  -            System.out.println(e.getMessage());
  -            e.printStackTrace();
  -        }
  -    }
  -
  -    /**
  -     * Check that the given internal representation of expr match the 
reference
  -     * AST
  -     * @param expr
  -     * @param refAST
  -     * @return boolean
  -     */
  -    public boolean checkAST(SimpleNode expr, Element refAST)
  -    {
  -        String nodeName = refAST.getAttributes().getNamedItem("name")
  -                                .getNodeValue();
  -
  -        if (XPathTreeConstants.jjtNodeName[expr.getId()].equals(nodeName))
  -        {
  -            int i = 0;
  -
  -            for (Node rac = refAST.getFirstChild(); rac != null;
  -                    rac = rac.getNextSibling())
  -            {
  -                if ("node".equals(rac.getNodeName()))
  -                {
  -                    if (!checkAST((SimpleNode) expr.jjtGetChild(i),
  -                                (Element) rac))
  -                    {
  -                        return false;
  -                    }
  -
  -                    i++;
  -                }
  -            }
  -
  -            if (i < expr.jjtGetNumChildren())
  -            {
  -                return false;
  -            }
  -
  -            return true;
  -        }
  -
  -        return false;
  -    }
  -
  -    public static void main(String[] args)
  -    {
  -        new Test(args);
  -    }
  -}
  +/*
  + * The Apache Software License, Version 1.1
  + *
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights
  + * reserved.
  + *
  + * Redistribution and use in source and binary forms, with or without
  + * modification, are permitted provided that the following conditions
  + * are met:
  + *
  + * 1. Redistributions of source code must retain the above copyright
  + *    notice, this list of conditions and the following disclaimer.
  + *
  + * 2. Redistributions in binary form must reproduce the above copyright
  + *    notice, this list of conditions and the following disclaimer in
  + *    the documentation and/or other materials provided with the
  + *    distribution.
  + *
  + * 3. The end-user documentation included with the redistribution,
  + *    if any, must include the following acknowledgment:
  + *       "This product includes software developed by the
  + *        Apache Software Foundation (http://www.apache.org/)."
  + *    Alternately, this acknowledgment may appear in the software itself,
  + *    if and wherever such third-party acknowledgments normally appear.
  + *
  + * 4. The names "Xalan" and "Apache Software Foundation" must
  + *    not be used to endorse or promote products derived from this
  + *    software without prior written permission. For written
  + *    permission, please contact [EMAIL PROTECTED]
  + *
  + * 5. Products derived from this software may not be called "Apache",
  + *    nor may "Apache" appear in their name, without prior written
  + *    permission of the Apache Software Foundation.
  + *
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  + * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  + * SUCH DAMAGE.
  + * ====================================================================
  + *
  + * This software consists of voluntary contributions made by many
  + * individuals on behalf of the Apache Software Foundation and was
  + * originally based on software copyright (c) 1999, Lotus
  + * Development Corporation., http://www.lotus.com.  For more
  + * information on the Apache Software Foundation, please see
  + * <http://www.apache.org/>.
  + */
  +package org.apache.xpath.rwapi.test;
  +
  +import org.apache.xpath.objects.XObject;
  +import org.apache.xpath.rwapi.XPathFactory;
  +import org.apache.xpath.rwapi.eval.Evaluator;
  +import org.apache.xpath.rwapi.expression.ConditionalExpr;
  +import org.apache.xpath.rwapi.expression.Expr;
  +import org.apache.xpath.rwapi.expression.ExprContext;
  +import org.apache.xpath.rwapi.expression.ExpressionFactory;
  +import org.apache.xpath.rwapi.expression.ForAndQuantifiedExpr;
  +import org.apache.xpath.rwapi.expression.Literal;
  +import org.apache.xpath.rwapi.expression.NodeTest;
  +import org.apache.xpath.rwapi.expression.OperatorExpr;
  +import org.apache.xpath.rwapi.expression.PathExpr;
  +import org.apache.xpath.rwapi.expression.StepExpr;
  +import org.apache.xpath.rwapi.expression.Variable;
  +import org.apache.xpath.rwapi.expression.Visitor;
  +import org.apache.xpath.rwapi.impl.parser.SimpleNode;
  +import org.apache.xpath.rwapi.impl.parser.XPath;
  +import org.apache.xpath.rwapi.impl.parser.XPathTreeConstants;
  +
  +import org.w3c.dom.Document;
  +import org.w3c.dom.Element;
  +import org.w3c.dom.Node;
  +import org.w3c.dom.NodeList;
  +
  +import java.io.StringReader;
  +
  +import javax.xml.parsers.DocumentBuilder;
  +import javax.xml.parsers.DocumentBuilderFactory;
  +
  +
  +/**
  + * Title:
  + * Description:
  + * Copyright:    Copyright (c) 2001
  + * Company:
  + * @author
  + * @version 1.0
  + */
  +public class Test
  +{
  +    public Test(String[] args)
  +    {
  +        try
  +        {
  +            final boolean dumpTree = ((args.length == 1)
  +                && args[0].equals("-dump")) ? true : false;
  +
  +            /*if(args[0].endsWith(".xquery"))
  +            {
  +              System.out.println("Running test for: "+args[0]);
  +              File file = new File(args[0]);
  +              FileInputStream fis = new FileInputStream(file);
  +              XPath parser = new XPath(fis);
  +              SimpleNode tree = parser.XPath2();
  +              if(dumpTree)
  +                tree.dump("|") ;
  +            }
  +            else
  +            {*/
  +            DocumentBuilderFactory dbf = 
DocumentBuilderFactory.newInstance();
  +            DocumentBuilder db = dbf.newDocumentBuilder();
  +            Document doc = db.parse(ClassLoader.getSystemResourceAsStream(
  +                        "org/apache/xpath/rwapi/test/xpathsamples.xml"));
  +            doc.normalize();
  +
  +            Element tests = doc.getDocumentElement();
  +            NodeList testElems = tests.getChildNodes();
  +            int nChildren = testElems.getLength();
  +            int testid = 0;
  +            boolean testSuccess = true;
  +
  +            for (int i = 0; i < nChildren; i++)
  +            {
  +                org.w3c.dom.Node node = testElems.item(i);
  +
  +                if (org.w3c.dom.Node.ELEMENT_NODE == node.getNodeType())
  +                {
  +                    testid++;
  +
  +                    String xpathString = ((Element) 
node).getAttribute("value");
  +                    System.out.println("Test[" + testid + "]: " + 
xpathString);
  +
  +                    XPath parser = new XPath(new StringReader(xpathString));
  +                    SimpleNode tree = parser.XPath2();
  +
  +                    if (SimpleNode.PRODUCE_RAW_TREE)
  +                    {
  +                        if (dumpTree)
  +                        {
  +                            tree.dump("|");
  +                        }
  +                    }
  +                    else
  +                    {
  +                        Expr expr = (Expr) tree.jjtGetChild(0);
  +
  +                        // Gets the reference AST to compare with
  +                        NodeList astNodes = ((Element) node)
  +                            .getElementsByTagName("ast");
  +
  +                        if ((astNodes != null) && (astNodes.getLength() >= 
1))
  +                        {
  +                            Node astNode = astNodes.item(0);
  +
  +                            if (!checkAST((SimpleNode) expr,
  +                                        (Element) ((Element) 
astNode).getElementsByTagName(
  +                                            "node").item(0)))
  +                            {
  +                                System.err.println(
  +                                    "Generated AST doesn't match the 
reference one");
  +
  +                                tree.dump("|");
  +                            }
  +                        }
  +                        else
  +                        {
  +                            System.err.println("No reference AST provided");
  +                        }
  +
  +                        String ab = expr.getString(true);
  +
  +                        //System.out.println(
  +                        //   "Parsed expr (abbreviate form):" + ab);
  +                        //System.out.println(
  +                        //   "Parsed expr (non-abbreviate form):"
  +                        //           + expr.getString(false));
  +                        if (!ab.equals(xpathString))
  +                        {
  +                            System.err.print(
  +                                "Bad external or internal representation: ");
  +                            System.err.println(ab + "  !=  " + xpathString);
  +                            testSuccess = false;
  +                        }
  +                    }
  +                }
  +            }
  +
  +            // }
  +            if (testSuccess)
  +            {
  +                System.out.println("Parsing test successful!!!");
  +            }
  +            else
  +            {
  +                System.out.println("Parsing Test fails!!!!!!!!!");
  +            }
  +
  +            // Test creation
  +            ExpressionFactory exprFct = XPathFactory.newInstance()
  +                                                    .newExpressionFactory();
  +
  +            Expr expr = exprFct.createExpr("child::tutu[10]");
  +            System.out.println("tutu[10] =? " + expr.getString(true));
  +
  +            PathExpr pathExpr = exprFct.createPathExpr(true);
  +            System.out.println("/ =? " + pathExpr.getString(true));
  +
  +            NodeTest nt = exprFct.createNameTest(null, "toto");
  +            pathExpr.addOperand(exprFct.createStepExpr(StepExpr.AXIS_CHILD, 
nt));
  +            System.out.println("/toto =? " + pathExpr.getString(true));
  +            System.out.println("/child::toto =? " + 
pathExpr.getString(false));
  +
  +            nt = exprFct.createNameTest(null, "titi");
  +            pathExpr.addOperand(exprFct.createStepExpr(
  +                    StepExpr.AXIS_DESCENDANT, nt));
  +
  +            System.out.println("/toto/descendant::titi =? "
  +                + pathExpr.getString(true));
  +            System.out.println("/child::toto/descendant::titi =? "
  +                + pathExpr.getString(false));
  +
  +            StepExpr se = (StepExpr) pathExpr.getOperand(0); // first step
  +            se.appendPredicate(exprFct.createIntegerLiteralExpr(50));
  +            System.out.println("/toto[50]/descendant::titi =? "
  +                + pathExpr.getString(true));
  +            System.out.println("/child::toto[50]/descendant::titi =? "
  +                + pathExpr.getString(false));
  +
  +            // Test visitor
  +            pathExpr.visit(new Visitor()
  +                {
  +                    /**
  +                    *
  +                    */
  +                    public boolean visitPath(PathExpr path)
  +                    {
  +                        System.out.println("visit path "
  +                            + path.getString(false));
  +
  +                        return true;
  +                    }
  +
  +                    /**
  +                     *
  +                     */
  +                    public boolean visitStep(StepExpr step)
  +                    {
  +                        System.out.println("visit step "
  +                            + step.getString(false));
  +
  +                        return true;
  +                    }
  +
  +                    /**
  +                     *
  +                     */
  +                    public boolean visitLiteral(Literal primary)
  +                    {
  +                        System.out.println(primary.getString(false));
  +
  +                        return true;
  +                    }
  +
  +                    /**
  +                     *
  +                     */
  +                    public boolean visitOperator(OperatorExpr arithmetic)
  +                    {
  +                        System.out.println(arithmetic.getString(false));
  +
  +                        return true;
  +                    }
  +
  +                    /**
  +                     *
  +                     */
  +                    public boolean visitConditional(ConditionalExpr 
condition)
  +                    {
  +                        System.out.println(condition.getString(false));
  +
  +                        return true;
  +                    }
  +
  +                    /**
  +                     *
  +                     */
  +                    public boolean visitForOrQuantifiedExpr(
  +                        ForAndQuantifiedExpr expr)
  +                    {
  +                        System.out.println(expr.getString(false));
  +
  +                        return true;
  +                    }
  +
  +                    /**
  +                     *
  +                     */
  +                    public boolean visitVariable(Variable var)
  +                    {
  +                        return false;
  +                    }
  +                });
  +
  +            // Evaluation
  +            Evaluator eval = XPathFactory.newInstance().newEvaluatorFactory()
  +                                         .createEvaluator();
  +
  +            ExprContext ctx = eval.createExprContext();
  +            ctx.getDynamicContext().setContextItem(doc.getDocumentElement());
  +
  +            // exprs
  +            Expr e = exprFct.createExpr("expr[2]/@value");
  +            Object res = eval.evaluate(ctx, e);
  +
  +            // Xalan dependent code
  +            System.out.println("10[$var] ?= " + ((XObject) res).str());
  +        }
  +        catch (Exception e)
  +        {
  +            System.out.println(e.getMessage());
  +            e.printStackTrace();
  +        }
  +    }
  +
  +    /**
  +     * Check that the given internal representation of expr match the 
reference
  +     * AST
  +     * @param expr
  +     * @param refAST
  +     * @return boolean
  +     */
  +    public boolean checkAST(SimpleNode expr, Element refAST)
  +    {
  +        String nodeName = refAST.getAttributes().getNamedItem("name")
  +                                .getNodeValue();
  +
  +        if (XPathTreeConstants.jjtNodeName[expr.getId()].equals(nodeName))
  +        {
  +            int i = 0;
  +
  +            for (Node rac = refAST.getFirstChild(); rac != null;
  +                    rac = rac.getNextSibling())
  +            {
  +                if ("node".equals(rac.getNodeName()))
  +                {
  +                    if (!checkAST((SimpleNode) expr.jjtGetChild(i),
  +                                (Element) rac))
  +                    {
  +                        return false;
  +                    }
  +
  +                    i++;
  +                }
  +            }
  +
  +            if (i < expr.jjtGetNumChildren())
  +            {
  +                return false;
  +            }
  +
  +            return true;
  +        }
  +
  +        return false;
  +    }
  +
  +    public static void main(String[] args)
  +    {
  +        new Test(args);
  +    }
  +}
  
  
  
  1.1.2.2   +1 -1      
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/test/Attic/Test2.java
  
  Index: Test2.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/test/Attic/Test2.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- Test2.java        20 Dec 2002 19:47:27 -0000      1.1.2.1
  +++ Test2.java        30 Jan 2003 00:45:42 -0000      1.1.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to