[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] position last and attributes


Subject: Re: [xsl] position last and attributes
From: "John P. McCaskey" <groups@xxxxxxxxxxxxxxxx>
Date: Thu, 20 Sep 2012 14:16:44 -0400

On 9/20/2012 1:41 PM, G. Ken Holman wrote:
At 2012-09-20 13:08 -0400, John P. McCaskey wrote:
Though not required to by spec, in practice do the major XSL processors treat attributes in document order, alphabetical order, or any other repeated order?

When writing XSL, I sometimes need to jump through hoops that could be avoided if I knew the processor would treat the attributes in the same order every time. If I knew what that order is, all the better.

My code might not work on a different XSLT processor or be guaranteed to work with different revs, but often that's OK.

Could you characterize where in your algorithms you find the order of nodes along the attribute axis important or useful?
An example right now is a stylesheet that renders TEI documents in a browser. The attributes of an element are listed in two places, displayed differently. I'd prefer they get displayed in the same order in both places.

And since I know that encoders in this community, by habit and tool, enter attributes in a certain order, I'd like the displayed order to be document order.

Right now, I'm just guessing that the processor will use document order, and so far I've been right. Fortunately, if it doesn't, nothing catastrophic happens. So I'm not bothering with any hoop jumping on this one.

-- John


Current Thread
Keywords