xsl-list
[Top] [All Lists]

Re: sorted for-each: preceding::sibling is not in sort order

2005-11-13 08:30:50
Hi Ferdinand,

Is this intended behaviour (I'm working with Xalan)?
Yes. It is in the specs.

One big disadvantage being that I'm cutting off all the parent
relationships when copying my node.

From what I understand, you insert the nodes in an RTF kind of
variable. Therefore these do not know anything about the position in
the document (that they had).

The usual workaround for this is to do a two-pass transformation. The
first one to sort the data into the order wanted (and do the part of
output that is dependent on the original order of nodes), the second
to do further processing (dependent on the sorted order of nodes).
Many do this in a single transformation with the xx:nodeset()
extension that - almost - all parsers have. This enables people to
access nodes in both original and sorted order on the same pass.

I hope this helps.
Ragulf Pickaxe :-)

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--