You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Henry Zongaro (JIRA)" <xa...@xml.apache.org> on 2005/06/15 20:39:46 UTC

[jira] Resolved: (XALANJ-2097) Problem with variable reference followed by self::node() if you use XSLTC

     [ http://issues.apache.org/jira/browse/XALANJ-2097?page=all ]
     
Henry Zongaro resolved XALANJ-2097:
-----------------------------------

    Fix Version: CurrentCVS
     Resolution: Fixed

Applied patch to CVS.

> Problem with variable reference followed by self::node() if you use XSLTC
> -------------------------------------------------------------------------
>
>          Key: XALANJ-2097
>          URL: http://issues.apache.org/jira/browse/XALANJ-2097
>      Project: XalanJ2
>         Type: Bug
>   Components: XSLTC
>     Versions: 2.6
>     Reporter: Nick Van den Bleeken
>      Fix For: CurrentCVS
>  Attachments: Step.patch, items.xml, problem2.xsl
>
> There is a problem when you have an XPath that contains a variable reference followed by self::node() if you use XSLTC (the problem does not occure if you just use Xalan without XSLTC).  
> If you have for example $var1/self::node(). The following XSLTC Step is generated :
> 	
> 	FilterParentPath(variable-ref(var1/node-set), step("self", -1))
> 	
> This step is translated to the following piece of code (I decompiled to byte code):
>         
> 	DTMAxisIterator dtmaxisiterator1 = (new CachedNodeListIterator(new StepIterator(dom.getTypedAxisIterator(3, 14), dom.getTypedAxisIterator(3, 15)))).setStartNode(i);
>     this;
>     dom;
>     new StepIterator(dtmaxisiterator1.cloneIterator(), new SingletonIterator(i));
>     
> As you can see the 'self::node()' step is translated to 'new SingletonIterator(i)'. This is not correct because new SingletonIterator(i) will refer to the node of the _parent of the FilterParentPath step.
> After applying the patch I made, the following code is generated if the _parent of the Step (self::node()) isn't a 'ParentLocationPath' :
>         
>     new StepIterator(dtmaxisiterator1.cloneIterator(), dom.getAxisIterator(13));
>     
> To run the sample just run
> 	org.apache.xalan.xslt.Process -in items.xml -xsl problem2.xsl -xsltc

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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