This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: arbitrary sorting (Part IV)
- To: "'xsl-list at mulberrytech dot com'" <xsl-list at mulberrytech dot com>
- Subject: RE: arbitrary sorting (Part IV)
- From: Kay Michael <Michael dot Kay at icl dot com>
- Date: Thu, 20 Jul 2000 15:10:37 +0100
- Reply-To: xsl-list at mulberrytech dot com
> I want to sort my elements (<element
> month="Jul">...</element>) in the
> same order as in <monthtab>. Note: there's no explizit number given in
> monthtab. Any ideas how to solve that?
> (perhaps by using position() somehow ...)
Tricky, because there's no XPath facility to determine the position of a
node relative to its siblings: you can only do this using <xsl:number/>, and
you can't invoke XSLT-level operations while computing a sort key. Not until
the next Saxon release, anyway, which will allow you to implement external
XPath functions in XSLT. But if you you're prepared to go outside the
standard, the whole problem becomes very easy!
Mike Kay
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list