Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xsl] ATTRIBUTE ORDER

From: Wendell Piez <wapiez@---------------->
To:
Date: 6/2/2006 6:53:00 PM
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


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent