This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
sorting union results
- From: Doug Howell <doug at creativemeasures dot com>
- To: XSL-List at lists dot mulberrytech dot com
- Date: Thu, 15 Aug 2002 13:09:49 -0400
- Subject: [xsl] sorting union results
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hi, all, Given a structure like this:
<glossary>
<entry>
<term></term>
<acronym></acronym>
<definition></definition>
</entry>
</glossary>
I'd like my stylesheet to create a list of glossary terms, inserting the
acronyms (as if they were terms) where they fit alphabetically in the list.
I'd like to avoid having to create another entry for each acronym and keep
the XML document smaller.)
I tried this:
<xsl:for-each select="//term|//acronym">
<xsl:sort select="." order="ascending"/>
<p><xsl:value-of select="."/>:</p>
</xsl:for-each>
This lists the terms and acronyms together, but doesn't sort them (they come
out in document order). I think I've read that the union operator can only
deliver the selected nodes in document order.
Is there any workaround to do what I want to do without creating an
intermediary document?
Thanks!
Doug Howell
Information Architect
Borders Group Inc.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list