You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by zo...@apache.org on 2007/06/08 12:25:41 UTC
svn commit: r545471 -
/xalan/java/trunk/src/org/apache/xalan/xsltc/compiler/Stylesheet.java
Author: zongaro
Date: Fri Jun 8 03:25:38 2007
New Revision: 545471
URL: http://svn.apache.org/viewvc?view=rev&rev=545471
Log:
Fix for XALANJ-2384.
The code generated for the topLevel and transform methods of a translet was
generated using DTM.ROOT_NODE (i.e., zero) as the value of the root node for
the initial context. However, that is not a valid node handle.
The proper way of getting the handle of root of the initial input document is
through DOM.getIterator().next().
Patch was reviewed by Christine Li (jycli () ca ! ibm ! com)
Modified:
xalan/java/trunk/src/org/apache/xalan/xsltc/compiler/Stylesheet.java
Modified: xalan/java/trunk/src/org/apache/xalan/xsltc/compiler/Stylesheet.java
URL: http://svn.apache.org/viewvc/xalan/java/trunk/src/org/apache/xalan/xsltc/compiler/Stylesheet.java?view=diff&rev=545471&r1=545470&r2=545471
==============================================================================
--- xalan/java/trunk/src/org/apache/xalan/xsltc/compiler/Stylesheet.java (original)
+++ xalan/java/trunk/src/org/apache/xalan/xsltc/compiler/Stylesheet.java Fri Jun 8 03:25:38 2007
@@ -1162,7 +1162,12 @@
"setFilter",
"(Lorg/apache/xalan/xsltc/StripFilter;)V");
- il.append(new PUSH(cpg, DTM.ROOT_NODE));
+ final int gitr = cpg.addInterfaceMethodref(DOM_INTF,
+ "getIterator",
+ "()"+NODE_ITERATOR_SIG);
+ il.append(toplevel.loadDOM());
+ il.append(new INVOKEINTERFACE(gitr, 1));
+ il.append(toplevel.nextNode());
current.setStart(il.append(new ISTORE(current.getIndex())));
// Create a new list containing variables/params + keys
@@ -1406,7 +1411,12 @@
il.append(new PUTFIELD(domField));
// continue with globals initialization
- il.append(new PUSH(cpg, DTM.ROOT_NODE));
+ final int gitr = cpg.addInterfaceMethodref(DOM_INTF,
+ "getIterator",
+ "()"+NODE_ITERATOR_SIG);
+ il.append(transf.loadDOM());
+ il.append(new INVOKEINTERFACE(gitr, 1));
+ il.append(transf.nextNode());
current.setStart(il.append(new ISTORE(current.getIndex())));
// Transfer the output settings to the output post-processor
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org