jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 12620] New: - position() and last() do not work in xtags:template match attributes
Date Fri, 13 Sep 2002 15:25:34 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12620>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12620

position() and last() do not work in xtags:template match attributes

           Summary: position() and last() do not work in xtags:template
                    match attributes
           Product: Taglibs
           Version: unspecified
          Platform: Sun
        OS/Version: Solaris
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: XTags Taglib
        AssignedTo: taglibs-dev@jakarta.apache.org
        ReportedBy: dawn.roth@sun.com


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

--
To unsubscribe, e-mail:   <mailto:taglibs-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:taglibs-dev-help@jakarta.apache.org>


Mime
View raw message