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

dynamic sort order

Subject: dynamic sort order
From: Nathan Shaw <n8_shaw@xxxxxxxxx>
Date: Wed, 30 Jul 2003 06:55:49 -0700 (PDT)
xslt sort order
I am trying to allow an end user to specify the sort
order of a result set returned from an LDAP query. I
am storing their sort request inside of the XML sent
into the LDAP server and plucking it off in my XSLT to
sort as they desired. However, I am running into a
challenge with my approach using a named template, as
you cannot call a named template inside of
xsl:apply-templates.

XML:

<supplementaryData>
    <sort>
      <sortField>employer</sortField>
      <sortField>lastName</sortField>
      <sortPage>search.cfm</sortPage>
    </sort>
    <display>
	<displayField>name</displayField>
	<displayField>code</displayField>
	<displayField>employer</displayField>
	<displayField>room</displayField>
	<displayField>phone</displayField>
	<displayField>email</displayField>
    </display>
  </supplementaryData>


XSLT:

<xsl:apply-templates select="searchResult">
  <!-- set the sort -->
  <!-- cannot do this here!!! How to do it??
  <xsl:call-template name="sort" /> -->
</xsl:apply-templates>

<!-- sort -->
<xsl:template name="sort">
  <xsl:for-each
select="/searchResults/supplementaryData/sort/sortField">
    <xsl:sort select="normalize-space(.)"/>
  </xsl:for-each>
</xsl:template>

Any ideas on how I can get around this hiccup?

--Nate


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

 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.