The position() and last() functions do not work in xtags:template match attributes. This means that you cannot match the last or specified item in a record set. You also can't match all of them and then test in the template if the current one is last (or whichever position you are looking for) since the functions do not work with <xtags:if test=""> either. (I saw a bug report for xtags:if and last/position, so I won't go into that more.) None of these matches will work properly: <xtags:template match="/root/item[last()]"> <xtags:template match="/root/item[position()=last()]"> <xtags:template match="/root/item[1]"> <xtags:template match="/root/item[position()=1]"> The position and last functions always return 0, so item[last()] and item[position()=last()] match for every element, not just the last one. The only way I have been able to get them to work is with <xtags:forEach> and <xtags:context>, but this limited functionality is a very painful workaround. You also cannot use this workaround with the xtags:stylesheet & xtags:template way of translating because the output comes out of order. These mailing list mails also discuss problems with position and last: http://www.mail-archive.com/taglibs-user@jakarta.apache.org/msg01506.html http://www.mail-archive.com/taglibs-user@jakarta.apache.org/msg01778.html http://www.mail-archive.com/taglibs-user@jakarta.apache.org/msg02505.html Thanks very much, Dawn Roth
*** Bug 29225 has been marked as a duplicate of this bug. ***
Resolving. Taglib has been retired.