[ 
https://issues.apache.org/jira/browse/XALANJ-1434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12476815
 ] 

Brian Minchau commented on XALANJ-1434:
---------------------------------------

This JIRA issue was created when bugzilla was used to track issues, the 
original bug is at:
http://issues.apache.org/bugzilla/show_bug.cgi?id=17400

When bugzilla was used there was no checkbox to grant Apache any rights.

Dmitry attached the patch to the bugzilla bug with the intention that it be 
applied to the Apache code, otherwise he wouldn't have attached it to the 
bugzilla report.

Also the patch is not substantial, it is two small one line fixes, to fix an 
off by one problem so I don't think that any more dilligence be done on this 
one, it is OK to apply the patch.

> org.apache.xpath.axes.AxesWalker getLastPos: duplicate predicate testing
> ------------------------------------------------------------------------
>
>                 Key: XALANJ-1434
>                 URL: https://issues.apache.org/jira/browse/XALANJ-1434
>             Project: XalanJ2
>          Issue Type: Bug
>          Components: XPath
>    Affects Versions: 2.5
>         Environment: Operating System: All
> Platform: All
>            Reporter: Dimitry E Voytenko
>         Assigned To: Xalan Developers Mailing List
>         Attachments: lastpos.patch
>
>
> In class org.apache.xpath.axes.AxesWalker method getLastPos there's a fragment
> of code:
>  walker.setPredicateCount(walker.getPredicateCount() - 1);
> Thus, in expression x[last() != position()][true()] first predicate is 
> checked 
> twice.
> XML sample:
> <?xml version="1.0" encoding="UTF-8"?>
> <doc>
>    <item>1</item>
>    <item>2</item>
>    <item>3</item>
> </doc>
> Result of 
>  <xsl:copy-of select="/doc/item[last() != position()][true()]"/>
> is
>  <item>1</item>
> and should be
>  <item>1</item>
>  <item>2</item>
> XSL work-around:
>  <xsl:copy-of select="(/doc/item[last() != position()])[true()]"/>
> Java code fix: replace code line in org.apache.xpath.axes.AxesWalker 
> getLastPos:
>  walker.setPredicateCount(walker.getPredicateCount() - 1);
> to
>  walker.setPredicateCount(this.m_predicateIndex);

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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

Reply via email to