rraguso / ajaxslt

Automatically exported from code.google.com/p/ajaxslt
Other
0 stars 0 forks source link

for-each sort #4

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Although the release notes of ajaxslt-0.4 states that 'xsl:sort' is fixed
in 'xsl:for-each' iterations, it seems to me that this still isn't fixed
completely. I have seen that a bug related to this issue was already
entered in the sf.net bugtracker, bug 1520401 - Sort is invalid, though
this bug report doesn't describe the issue properly but contains just a
post of xslt and xml instead.

I've looked at the ajaxslt source and located the issue. I found that
method "xsltProcessContext" calls the xsltSort on a sortContext without all
childnodes in its nodelist. Then method "xsltForEach" is called to do the
actual "xsl:for-each". It reads the nodelist from the context and uses it
without sorting it.

This issue can be fixed by retrieving the nodelist, then sorting it and
calling xsltForEach with the sorted context. The nodelist is always
retrieved from the "select" attribute within the "xsl:for-each" element, as
the select attribute is required with for-each iterations, while optional
for apply-templates.

A patch against xslt.js of release 0.4 is attached.

Original issue reported on code.google.com by bjpbak...@gmail.com on 11 Dec 2006 at 8:47

Attachments:

GoogleCodeExporter commented 9 years ago
This issue seems to be resolved in 0.5 release as well.

Original comment by bjpbak...@gmail.com on 11 Dec 2006 at 12:04

GoogleCodeExporter commented 9 years ago
That was fixed indeed in release-0-5.

Original comment by steffen....@gmail.com on 15 Dec 2006 at 8:48