[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Sorting and ordering by attributes

Subject: Sorting and ordering by attributes
From: "Shellenberger, Mark" <MShellenberger@xxxxxxx>
Date: Tue, 24 Apr 2001 10:23:18 -0400
xsl ordering
> I've looked through the archives and the FAQ and I can't find anything
> that seems close...although I could be way off in my thought process on
> this one.  Anyway, here's my question:
> 
> I wish to take several tag groups, sort them by 1 attribute, link them
> through another attribute, and only print one of the tags once....confused
> yet?  Seems to me that I need a combination of <xsl:sort>, <xsl:order> and
> <xsl:for-each> but I am really confused as to what combination.
> 
> Here's the code:
> XML:
> <AUTHGRP>
>   <AUTHOR ID="au1" RIDS="aff1">
>     <FNAME>Brian</FNAME>
>     <SURNAME>Smith</SURNAME>
>   </AUTHOR>
>   <AUTHOR ID="au2" RIDS="aff2">
>     <FNAME>Ruth</FNAME>
>     <SURNAME>Jones</SURNAME>
>   </AUTHOR>
>   <AUTHOR ID="au3" RIDS="aff1">
>     <FNAME>Luise</FNAME>
>     <SURNAME>Brown</SURNAME>
>   </AUTHOR>
>   <AFF ID="aff1">
>     <ORGDIV>School of Psychology</ORGDIV>
>     <ORGNAME>University of New England</ORGNAME>
>     <STATE>New South Wales</STATE>
>     <COUNTRY>Australia</COUNTRY>
>   </AFF>
>   <AFF ID="aff2">
>     <ORGDIV>Psychology Department</ORGDIV>
>     <ORGNAME>Yale University</ORGNAME>
>   </AFF>
> </AUTHGRP>
> 
> XSL:
> <xsl:for-each select="ARTICLE/FRONTMAT/AUTHGRP/AUTHOR">
>     <b align="center"><xsl:value-of select="FNAME"/></b>
>     <b><xsl:value-of select="SURNAME"/></b>
>     </xsl:for-each>
>     <br/>
>     
>     <xsl:for-each select="ARTICLE/FRONTMAT/AUTHGRP/AFF">
>       <xsl:value-of select="ORGDIV"/>
>       <xsl:value-of select="ORGNAME"/>
>       <xsl:value-of select="STATE"/>
>       <xsl:value-of select="COUNTRY"/><br/>
>     </xsl:for-each>
> 
> <!--Currently this prints the authors and the affs twice-->
> 
> What it should look like:
> 
> Brian Smith and Luise Brown
> School of Psychology, University of New England, South Wales, Australia
> 
> Ruth Jones
> Yale University
> 
> Any ideas, even something telling me what I am trying to do, would be
> greatly appreciated.  I've been working on this section for a while and if
> I can solve it then I'll have lots of other problems in the same document
> solved as well.
> 
> Thanks!!
> 
> Mark D. Shellenberger
> Electronic Publishing Specialist
> The American Psychological Association
> Washington, DC 20002
> mshellenberger@xxxxxxx
> 

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.