#431 Path expressions inside constructor wrongly ordered

v8.6
closed
5
2012-10-08
2005-11-21
Michael Kay
No

If an element constructor (or document node
constructor) appears in a context where the results of
the expression are not required to be sorted (for
example, on the left hand side of the "/" operator),
then the "unorderedness" of the expression is wrongly
passed down to the contents of the element constructor.

For example if the expression

{$x/ancestor-or-self::*}

is used on the left-hand side of the "/" operator, then
the ancestors may appear in the result in reverse order
rather than forwards order.

Source fix: change the promoteInst() method of
ParentNodeConstructor.java to

protected void promoteInst(PromotionOffer offer) throws
XPathException {
if (offer.action != PromotionOffer.UNORDERED) {
content = doPromotion(content, offer);
}
}

Test cases added: qxmp304, 305.

Discussion

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks