Subject: Re: [xsl] xsl:sort descending causes attribute nodes to be created after children, causing an error From: Abel Braaksma <abel.online@xxxxxxxxx> Date: Tue, 16 Jan 2007 14:47:59 +0100 |
For attribute nodes the value of the sort key (child::text()) will always be
an empty sequence. An empty sequence sorts before any other value, so in
descending order it sorts last, and since the template with match="@*"
creates attribute nodes, you will be adding attributes to the parent after
the children, which is an error.
This behaviour is certainly correct, and I'm not sure which part of it you
are questioning.
Incidentally, if any of your child elements contains an embedded comment,
the sort will fail because text() selects more than one node, and it's an
error in 2.0 for the sort key to be a sequence longer than one (in 1.0 all
but the first are ignored).
Cheers, -- Abel
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] xsl:sort descending cause, Michael Kay | Thread | Re: [xsl] xsl:sort descending cause, David Carlisle |
Re: [xsl] xsl:sort descending cause, Abel Braaksma | Date | Re: [xsl] xsl:sort descending cause, David Carlisle |
Month |