RE: [xsl] Why Are My Tunnel Parameters Not Working?

Subject: RE: [xsl] Why Are My Tunnel Parameters Not Working?
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Thu, 6 Mar 2008 15:58:35 -0000
> As Mike Kay pointed out recently, with union "node()|@*" the 
> nodes will be de-duplicated and sorted into document order, 
> but with a sequence "@*,node()" the nodes are processed in 
> sequential order.
> 
> So using the sequence constructor instead of union you save 
> the unnecessary step of sorting and de-duping.

Actually, I discovered another twist on this a few days ago. I had started
rewriting (@*|*) as (@*,*) to avoid the need for a sort, and the consequence
was that an unnecessary sort was added for a/(@*|*) because it no longer
recognized that this path expression was "naturally" sorted.

But of course once you spot such coding patterns it's easy to analyze them
and do the right thing.

Michael Kay
http://www.saxonica.com/

Current Thread