You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by mo...@apache.org on 2001/09/20 16:33:30 UTC

cvs commit: xml-xalan/java/src/org/apache/xalan/xsltc/compiler Step.java

morten      01/09/20 07:33:30

  Modified:    java/src/org/apache/xalan/xsltc/compiler Step.java
  Log:
  A fix for layers of parent location paths and steps representing an
  XPath pattern/expression like /foo/*/bar
  PR:		bugzilla 3311
  Obtained from:	n/a
  Submitted by:	morten@xml.apache.org
  Reviewed by:	morten@xml.apache.org
  
  Revision  Changes    Path
  1.10      +9 -3      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Step.java
  
  Index: Step.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Step.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- Step.java	2001/08/27 09:07:19	1.9
  +++ Step.java	2001/09/20 14:33:30	1.10
  @@ -1,5 +1,5 @@
   /*
  - * @(#)$Id: Step.java,v 1.9 2001/08/27 09:07:19 morten Exp $
  + * @(#)$Id: Step.java,v 1.10 2001/09/20 14:33:30 morten Exp $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -80,7 +80,7 @@
       private final Vector _predicates; 	// may be null
   
       // Type of the node test.
  -    private final int _nodeType;
  +    private int _nodeType;
   
       private boolean _hadPredicates = false;
   
  @@ -143,7 +143,6 @@
   	return _nodeType;
       }
   
  -
       /**
        * Returns the vector containing all predicates for this step.
        */
  @@ -277,6 +276,13 @@
   	    if (_type == Type.Node) {
   		il.append(methodGen.loadContextNode());
   		return;
  +	    }
  +
  +	    // Special case for /foo/*/bar
  +	    SyntaxTreeNode parent = getParent();
  +	    if ((parent instanceof ParentLocationPath) &&
  +		(parent.getParent() instanceof ParentLocationPath)) {
  +		if (_nodeType == NodeTest.ELEMENT) _nodeType = NodeTest.ANODE;
   	    }
   
   	    // "ELEMENT" or "*" or "@*" or ".." or "@attr" with a parent.
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org