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

Re: Re: Default attribute value templates

Subject: Re: Re: Default attribute value templates
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Thu, 28 Jun 2001 03:58:55 -0700 (PDT)
xml generic sort by attribute
Trevor Nash wrote:

> Thanks to Mike Kay and Dimitre Novatchev for their answers addressing
> the example given.  The bottom line seems to be that using AVTs for
> xsl elements which have defaults is a tricky business.
> 
> My example was over simplified: I want all the attributes of xsl:sort
> (except "select" which is another problem entirely) not just 'order'.

[snip]

> Yes, thats the sort of thing I had in mind.  The problem is xsl:sort
> has four attributes which take AVTs, which makes 16 xsl:whens and 16
> copies of the xsl:apply-templates which could have all sorts of other
> stuff like modes, selects, with-params etc.  Bad news for maintenance
> and testing.  If we use Mike's method where it applies this comes down
> to 4, but its still uglier than I like.
> 
> I think I will do two passes: the first to generate a stylesheet with
> the right xsl:sort in it, then a second to apply it.  This lets me
> parameterise 'select' as well, and with a change to the way 'x' is
> defined allow more than one sort key.

In all complicated cases of using xsl:sort I'd strongly recommend to use the generic
sort() template (see http://www.vbxml.com/downloads/default.asp?id=v2001611171627 )

It is not dependent on and limited by any particular way of defining or comparing
the sort keys -- because this is done in a caller-supplied "compare"-template.

The benefits of using a generic sort template are:

  - conceptual simplicity.
  - maximum reusability.
  - no limitations.
  - less error-prone.
  - less time consuming to program.
  - more efficient than a multi-pass algorithm.

Cheers,
Dimitre Novatchev.




__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.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.