[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: dynamic sorting
At 2004-02-05 16:02 +0100, Peter Billen wrote:
Imagine the following part of an xml file: 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 work anymore: 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: <xsl:apply-templates select="/*/*[name(.)=$sort]"/> ... 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 criteria. You'll need to share more information to get more help. ....................... Ken -- 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|