[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XSL-question

  • From: "G. Ken Holman" <gkholman@C...>
  • To: xml-dev@i...
  • Date: Thu, 18 Nov 1999 12:31:27 -0500

Re: XSL-question
At 99/11/18 18:58 +0200, Marcus.Bernhardson@n... wrote:
>Im new to this list (and pretty new to XML/XSL...) and i hope that its ok to
>ask a question about XSL here. Please tell me if Im at the wrong place.

A better place is:

  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

>I have a very anoying problem i cant solve using XSL with IE5.
>...
>When I sort with order-by I wanna use a variable or a function that returns
>the sortingcriteria. I cant get it to work, is it possible?

Such a criterion is available using W3C XSLT, not IE5 XSL ... with W3C XSLT 
you can specify a sort key based on a function.

>What I mean is that I wanna do something like this:
>
>* with a variable called selectedSort that contains the string
>'childelement1', 'childelement2' or 'childelement3':
><xsl:for-each select="root/element" order-by="+selectedSort">

Oh.  I'm not really sure what you are asking for, then.

>* with a function that returns the string 'childelement1', 'childelement2'
>or 'childelement3':
><xsl:for-each select="root/element" order-by="+selectedSort()">
>
>If this would work then i could use 1 XSL-file instead of 1 for every
>sorting/filtering combination (would be many....).

Have you examined using general entities (but may not work in IE5) to 
parameterize the encoding of attributes and sub-elements?

>When i filter i do like this:
>  <xsl:for-each select="root/element[childelement= 'criteria1']"
>order-by="+childelement1">
>
>I have same problem here. I wanna be able to do something like this:
>
><xsl:for-each select="root/element[childelement1= selectedCriteria]"
>order-by="+childelement1">
>or
><xsl:for-each select="root/element[childelement1= selectedCriteria()]"
>order-by="+childelement1">

Same answer from me ... such parameterization as I *think* you've described 
isn't possible in XSLT.  But, I think if you were to parameterize the 
*stylesheet markup* instead of trying to parameterize *stylesheet 
behaviour*, you will get what you are looking for.

Also, I expect you want to do "//element[..." to choose from all elements 
with the given predicate (which is not quite what you are asking for).

I hope this helps.

................... Ken

--
G. Ken Holman                    mailto:gkholman@C...
Crane Softwrights Ltd.             http://www.CraneSoftwrights.com/x/
Box 266, Kars, Ontario CANADA K0A-2E0   +1(613)489-0999   (Fax:-0995)
Web site: XSL/XML/DSSSL/SGML services, training, libraries, products.
Practical Transformation Using XSLT and XPath      ISBN 1-894049-02-0
Next instructor-led training:              1999-12-05/06, 1999-12-07,
-                            2000-02-27/28, 2000-05-11/12, 2000-05-15


xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i...
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To unsubscribe, mailto:majordomo@i... the following message;
unsubscribe xml-dev
To subscribe to the digests, mailto:majordomo@i... the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@i...)



PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.