[XML-SIG] XSLT sorting by "authors" element, with multiple authors

Thomas B. Passin tpassin@comcast.net
Mon, 12 May 2003 21:42:19 -0400


[Jon Berry]
>...
> In initial searches, it looked like the   xsl:for-each-group
> and/or xsl:function constructs might help, but they don't seem
> to be supported by the current PyXML/4Suite implementations.
>
> So, with the constraint that I'm trying to avoid buying a book for now,
> is this doable using templates, easy, and currently implementable
> with free software?
>

Best to go to the Mulberry xslt list with xslt questions!  The two
instructions you mention are not in xslt1.0 but rather in the draft xslt2.0.
It seems unlikely that the 4Thought people will ever have much interest in
getting 4xslt conformant with xslt2.0, so you need another approach.

Your problem is a grouping problem, and most grouping problems can be solved
with xslt1.0 - you have to learn a few patterns that people have discovered,
and sometimes be a little creative, but you can generally solve them.  Check
the FAQs, including Jeni Tennison's web site.

If all else fails, you can accomplish your task by using a 2-pass process.
Use one stylesheet to do an intermediate transform, then a final one to do
the rest (which may at that point just be the sorting).

The latest version of Mike Kay's Saxon supports good parts of the draft 2.0
Rec.  You could use it from Python by means of a system call.  Bear in mind,
though, that xslt2.0 is not completely stable yet, and also there are some
subtle (and some not-so-subtle, but those are less likely to cause problems)
differences between similar constructions in 1.0 and 2.0.

Cheers,

Tom P