tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james_strac...@yahoo.co.uk>
Subject Re: xtags:ForEach question (involving parameters)
Date Mon, 16 Jul 2001 11:20:42 GMT
From: "John Townsend" <john.townsend@listenpoint.com>
> What I would like to do is sort all of the person objects that are
> returned from the forEach select statement by an attribute (name, phone
> number, title, etc.)

Here's an example....

<%-- parse some XML --%>

<xtags:parse>
<people>
    <person name="James">
        ..
    </person>
    <person name="John">
        ..
    </person>
</people>
</xtags:parse>

<%-- now iterate through people in @name order --%>

<xtags:forEach select="/people/person" sort="@name">
    Name: <xtags:valueOf select="@name"/>
</xtags:forEach>


James


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


Mime
View raw message