[XSL-LIST Mailing List Archive Home]
Re: [xsl] dynamic sorting
At 2004-02-05 16:02 +0100, Peter Billen wrote:
Imagine the following part of an xml file:
The following works perfect:
I can't imagine how that works ... you are sorting a node set of element
nodes named person, but the criterion for the sort is the fname child of
person child of person, and I don't see that your person elements have any
children named person.
But when I put the string "person" into a parameter named "sort", it doesn't
That declares the string "person". To default the argument to a node set,
do the following:
<xsl:param name="sort" select="person"/>
My goal is that the user of my xsl file can give a parameter "sort" (to his
xslt parser) which defines his preferred way of sorting.
"preferred"? Parameters passed are strings, not node sets.
You will probably need something lie:
... or some such to accept a string as the name of an element type whose
elements are to be sorted. But you might then have problems with the sort
You'll need to share more information to get more help.
Public courses: sign up for one or both soon to reserve your seat!
Each week: Monday-Wednesday: XSLT/XPath; Thursday-Friday: XSL-FO
Washington, DC: 2004-03-15 San Francisco, CA: 2004-03-22
Hong Kong, China: 2004-05-17 Bremen, Germany: 2004-05-24
World-wide on-site corporate, government & user group XML training
G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995)
Male Breast Cancer Awareness http://www.CraneSoftwrights.com/s/bc
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list