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

Re: Sorting using more than value

Subject: Re: Sorting using more than value
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Fri, 12 Nov 2010 12:50:17 -0500
Re:  Sorting using more than value
Hi Susan,

At 05:38 PM 11/11/2010, Gerrit wrote:
On 11.11.2010 23:24, Susan Bodnik wrote:
Wendell, thanks for your reply - much appreciated.

I made the following change to the
template:<xsl:for-each-groupselect="//indexterm"group-by="(@term.entry,text()[1])">

Try "(@term.entry,text())[1]" as Wendell suggested, which is just a shorthand for
if (@term.entry) then @term.entry else text()

This is true with one tiny caveat: if indexterm ever has mixed content, particularly more than one text node. I don't think you want any indexterms with more than a single text node to appear as many times as they have text nodes, each time with that fragment of text. (This can sometimes happen if comments or processing instructions, not only inline elements, happen to intervene.)


<indexterm>Global <!-- was "World" -->Health</indexterm>

There are two text nodes there, with the values "Global " and "Health".

That's another reason why group-by="(@term.entry,.)[1]" is probably better.

Or, in Gerrit's more transparent style, "if (@term.entry) then @term.entry else ."

Cheers,
Wendell



======================================================================
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
======================================================================

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.