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

Re: XSL/XPath Dynamic sort key

Subject: Re: XSL/XPath Dynamic sort key
From: "Fett Boba" <stucco_junk@xxxxxxxxxxx>
Date: Fri, 11 Jul 2003 13:49:36 +0000
xpath sort
And my final line of code supports up to three dynamic sub levels with the final reference being an element or attribute.

<xsl:sort select="*[name()=$sort_select_lvl_3]/*[name()=$sort_select_lvl_2]/*[name()=$sort_select_lvl_1]/@*[name()=$sort_select]|*[name()=$sort_select_lvl_3]/*[name()=$sort_select_lvl_2]/*[name()=$sort_select_lvl_1]/*[name()=$sort_select]|*[name()=$sort_select_lvl_2]/*[name()=$sort_select_lvl_1]/@*[name()=$sort_select]|*[name()=$sort_select_lvl_2]/*[name()=$sort_select_lvl_1]/*[name()=$sort_select]|*[name()=$sort_select_lvl_1]/@*[name()=$sort_select]|*[name()=$sort_select_lvl_1]/*[name()=$sort_select]|*[name()=$sort_select]" data-type="{$sort_data_type}" order="{$sort_order}" />

and believe it or not it actually works. I wish there was a better way but I'll just not worry about it. The reason I can't use saxon, even though I would really like to, is I need it web enabed. (I am assuming here that using saxon limits you to the local command line, which I'm sure is completely wrong)

<xsl:sort select="*[name()=$sort_select]|author/*[name()=$sort_select]"
data-type="{$sort_data_type}" order="{$sort_order}" />

and just set the sort_select param to be 'uid' or 'last_name' or whatever
you want. In each case one branch of the | will return nothing, but
that's OK.

_________________________________________________________________
STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail



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.