|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XSLT 1.0: Problem grouping disparate unordered dat
Nick,
I would approach it like this (I hope I've understood your requirements exactly): <xsl:for-each select="//ape[@priority > 2]">
<xsl:sort select="[fancy sort key ordering by type of ape]"/>
<xsl:sort select="priority"/>
<xsl:sort select="date"/>
<section>
<xsl:if test="position() < 4">
... output ...
</xsl:if>
</section>
</xsl:if>This would reduce the problem to figuring out the sort key that would let you sort by Gorillas, Chimps, Orangs and Bonobos in that order. Where's David Carlisle when you need him? He could probably concoct something using translate() to do this in 1.0. How about select="translate(@type,'GCOB','abcd')"/> as something simple, which ought nonetheless to work? But you said your actual data isn't about apes, so knowing the solution to that particular problem won't actually help you. The tougher part of your problem is there: "The types are arbitrary names (not sortable)". A trick with translate() may be your best hope to make them so; without it, it's going to be tough to do in a single pass. Cheers, Wendell At 01:00 PM 3/15/2006, you wrote: Hi all, ====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








