A match pattern containing the predicate [position()!=last
()] or [position()<last()] gives the wrong answer: if
selects the nodes where position()=last(), and fails to
select those where position()!=last().
Applies to 6.5.2, 7.1, and 7.2.
Circumvention: declare a higher-priority template rule
with the pattern [position()=last()], and leave this filter off
the rule for matching other nodes.
Source fix (tested on Saxon 7.2):
(a) in expr.IsLastExpression, add the method
public boolean getCondition() {
return condition;
}
(b) in pattern.LocationPathPattern, around line 108 in
Saxon 7.2 or line 90 in Saxon 6.5.2, change the test:
if (nodeTest.getItemType() == Type.ELEMENT &&
numberOfFilters==1 &&
filters[0] instanceof IsLastExpression)
to:
if (nodeTest.getItemType() == Type.ELEMENT &&
numberOfFilters==1 &&
filters[0] instanceof IsLastExpression &&
((IsLastExpression)filters[0]).getCondition())
Source code fixed in both branches.
Test case added: pos64
Michael Kay
XSLT conformance
v6.5.2
Public
|
Date: 2002-11-18 14:04 Logged In: YES |
| Field | Old Value | Date | By |
|---|---|---|---|
| status_id | Open | 2003-08-14 14:21 | mhkay |
| resolution_id | None | 2003-08-14 14:21 | mhkay |
| close_date | - | 2003-08-14 14:21 | mhkay |
Copyright © 2010 Geeknet, Inc. All rights reserved. Terms of Use