tmiller     01/09/12 10:41:49

  Modified:    java/src/org/apache/xalan/xsltc/compiler xpath.cup
  Log:
  bug fix 3312, //xx/descendant works now
  
  Revision  Changes    Path
  1.14      +29 -23    xml-xalan/java/src/org/apache/xalan/xsltc/compiler/xpath.cup
  
  Index: xpath.cup
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/xpath.cup,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- xpath.cup 2001/09/10 14:41:24     1.13
  +++ xpath.cup 2001/09/12 17:41:49     1.14
  @@ -1,5 +1,5 @@
   /*
  - * @(#)$Id: xpath.cup,v 1.13 2001/09/10 14:41:24 tmiller Exp $
  + * @(#)$Id: xpath.cup,v 1.14 2001/09/12 17:41:49 tmiller Exp $
    *
    * Copyright 2000 Sun Microsystems, Inc. All Rights Reserved.
    * 
  @@ -476,31 +476,37 @@
           }
           :};
   
  +
   AbbreviatedAbsoluteLocationPath ::= DSLASH RelativeLocationPath:rlp
  -        {: 
  -        // GTM bug fix 2553; 3360 (handles predicates in nodeStep2). 
  -        // Try to get node type and axis from the RelativeLocationPath
  -        int nodeType = NodeTest.ELEMENT;
  -        int axis = Axis.CHILD;
  -        Vector predicates = null;
  -        if (rlp instanceof Step) {
  -            nodeType = ((Step)rlp).getNodeType();
  -            axis = ((Step)rlp).getAxis();
  -            predicates = ((Step)rlp).getPredicates();
  -        }
  -        // create the new abs location path
  -        Step nodeStep1 = new Step(Axis.DESCENDANTORSELF, -1, null);
  -        //Step nodeStep2 = new Step(axis, nodeType, null);
  -        Step nodeStep2 = new Step(axis, nodeType, predicates);
  -        AbsoluteLocationPath path =  new AbsoluteLocationPath(
  -             new ParentLocationPath(nodeStep1, nodeStep2));
  +        {:
   
  -        // uncomment for no dup filtering. Used in debugging. 
  -        //RESULT = path; 
  +     // GTM bug fix 2553; 3360 (handles predicates in nodeStep2). 
  +     AbsoluteLocationPath absLocPath = null;
  +     if (rlp instanceof ParentLocationPath) {
  +         // GTM, bug fix 3312  
  +            Step nodeStep1 = new Step(Axis.DESCENDANTORSELF, -1, null);
  +         absLocPath = new AbsoluteLocationPath(
  +                   new ParentLocationPath(nodeStep1, rlp));
  +     }
  +     else {
  +         int nodeType = NodeTest.ELEMENT;
  +            int axis = Axis.CHILD;
  +            Vector predicates = null;
  +
  +         if (rlp instanceof Step) {
  +                nodeType = ((Step)rlp).getNodeType();
  +                axis = ((Step)rlp).getAxis();
  +                predicates = ((Step)rlp).getPredicates();
  +         }
  +         // create the new abs location path
  +            Step nodeStep1 = new Step(Axis.DESCENDANTORSELF, -1, null);
  +            Step nodeStep2 = new Step(axis, nodeType, predicates);
  +         absLocPath = new AbsoluteLocationPath(
  +                   new ParentLocationPath(nodeStep1, nodeStep2));
  +     }
   
  -           // Filtered the Abs Loc Path to remove dups 
  -        RESULT = new FilteredAbsoluteLocationPath(path); 
  -        :};
  +     RESULT = new FilteredAbsoluteLocationPath(absLocPath);  
  +     :};
   
   Step ::= NodeTest:ntest
           {: RESULT = new Step(Axis.CHILD,
  
  
  

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

Reply via email to