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/11/01 16:10:29 UTC

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

morten      01/11/01 07:10:29

  Modified:    java/src/org/apache/xalan/xsltc/compiler Sort.java
  Log:
  Fix for sort-elements used with apply-templates elements with no select
  attribute.
  PR:		bugzilla 3519
  Obtained from:	n/a
  Submitted by:	morten@xml.apache.org
  Reviewed by:	morten@xml.apache.org
  
  Revision  Changes    Path
  1.8       +11 -5     xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Sort.java
  
  Index: Sort.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Sort.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Sort.java	2001/10/08 10:41:39	1.7
  +++ Sort.java	2001/11/01 15:10:29	1.8
  @@ -1,5 +1,5 @@
   /*
  - * @(#)$Id: Sort.java,v 1.7 2001/10/08 10:41:39 morten Exp $
  + * @(#)$Id: Sort.java,v 1.8 2001/11/01 15:10:29 morten Exp $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -215,19 +215,25 @@
   
   	// Get the current node iterator
   	if (nodeSet == null) {	// apply-templates default
  -	    Mode.compileGetChildren(classGen, methodGen,
  -				    methodGen.getLocalIndex("current"));
  +	    final int children = cpg.addInterfaceMethodref(DOM_INTF,
  +							   "getAxisIterator",
  +							   "(I)"+
  +							   NODE_ITERATOR_SIG);
  +	    il.append(methodGen.loadDOM());
  +	    il.append(new PUSH(cpg, Axis.CHILD));
  +	    il.append(new INVOKEINTERFACE(children, 2));
   	}
   	else {
   	    nodeSet.translate(classGen, methodGen);
  -	    il.append(new PUSH(cpg,methodGen.getLocalIndex("current")));
  -	    il.append(new INVOKEINTERFACE(setStartNode,2));
   	}
   	
   	// Compile the code for the NodeSortRecord producing class and pass
   	// that as the last argument to the SortingIterator constructor.
   	compileSortRecordFactory(sortObjects, classGen, methodGen);
   	il.append(new INVOKESPECIAL(init));
  +
  +	il.append(methodGen.loadCurrentNode());
  +	il.append(new INVOKEINTERFACE(setStartNode,2));
       }
   
   
  
  
  

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