xsl-list
[Top] [All Lists]

Re: [xsl] ATTRIBUTE ORDER

2006-06-02 11:53:13
Hi,

At 12:26 AM 5/28/2006, M. David wrote:
Both Dimitre and Dr. Kay bring out an important point to understand.  The
only counter argument I would make is "How many people actually use more
than one XSLT processor on the same code base in production?"

While the cross-platform differences are important to understand, it would
seem the fact that the code will run cross-platform is the most important
piece to all of this.  The fact that theres a chance the results might be
different under certain conditions would allow nicely for a simple comment
to be added in this section of the code that states something like:

<!-- WARNING: Different XSLT processors can produce different output
results "Since collating sequences for xsl:sort aren't defined in the
spec" -->

Obviosuly you could leave out the quotes -- just making sure I pulled out
the fact that I was quoting from Dr. Kay's email in this response.

Of course, this kind of information can't be overlooked, as you simply
have no idea who might be running your code and with what processor at any
point in the future....

No, you have no idea ... except when you do. I have any number of stylesheets that will never run anywhere except on my own system, in a processor of my choice. I also write (and deliver to clients) stylesheets that are warranted to "run the same" on X version of Y processor (due to their use of extension functions or whatever). These cases I think are safely within the zone.

In short, it's true that collation order creates an edge case for the sort-your-attributes solution to the attribute-ordering problem. On the other hand, one is not always looking at an edge case.

Yet one of the reasons this list is a useful resource is that we're very careful, even sometimes to a fault, about edge cases. I could have qualified my suggestion further (actually I did remember the caveat, but was in haste as I wrote :-). But then we wouldn't have Mike's (and David's) correction to think about, or M. David's recommendation to hedge the hedge with comments.

The XSLT 2.0 solution, select="(@mike, @davidc, @dimitre)", works great -- as long as you know who your attributes are ahead of time. (Which the OP did, IIRC. But I don't think he was using 2.0, and personally haven't come to the point where I'm recommending 2.0 solutions to 1.0 problems except in dramatic cases.)

Cheers,
Wendell


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>