dr***@msn.com writes:
I'm calling a template that I'd like to pass a sort node set to. I'm
creating the node set with <xsl:copy-of>...is there a way to sort the
set prior to passing it? If not, what's a reasonable alternative?
Thanks in advance,
David
node sets are (as their name implies) sets, ie unordered data structures:
the set {1,2,3} is the same as the set {2,3,1}.
In XSLT1 you need to sort as the set as it is used (using xsl:sort on an
xsl:for-each or xsl:apply-templates) You can not store an order in the
data structure itself.
XSLT2 of course will abandon the node set data type and instead use
sequences (which are an ordered data structure) XSLT2 is still in draft
but there are implementations eg saxon 8.
David