Re: XSL-question: sort with parameter

2002-03-27 Thread Leonid Kleiner

Try this. Here datatypes also are of concern :).

xsl:when test=$xsldttype='number'
  xsl:for-each select=DATALINE/*[name() = $xslcol]
  xsl:sort select=. data-type=number/
xsl:call-template name = tablerow /
 /xsl:for-each
 /xsl:when

xsl:when test=$xsldttype='text'
  xsl:for-each select=DATALINE/*[name() = $xslcol]
  xsl:sort select=./
xsl:call-template name = tablerow /
 /xsl:for-each
 /xsl:when

Try to search for examples on www.google.com.

Have fun,
Leonid Kleiner


- Original Message - 
From: Axel Honfi [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, March 27, 2002 6:22 AM
Subject: XSL-question: sort with parameter


 Hi!
 
 I passed a parameter to a stylesheet and I can get the value with
 xsl:value-of select=$order-by/.
 
 But I need to sort data by the value of the parameter like
 
 xsl:sort select=$order-by order=ascending/.
 
 But with this nothing happens and all other forms I tried also failed.
 
 Does anyone know how to work this?
 
 Thanks a lot
 
 Axel
 
 -
 Please check that your question has not already been answered in the
 FAQ before posting. http://xml.apache.org/cocoon/faqs.html
 
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




XSL-question: sort with parameter

2002-03-26 Thread Axel Honfi

Hi!

I passed a parameter to a stylesheet and I can get the value with
xsl:value-of select=$order-by/.

But I need to sort data by the value of the parameter like

xsl:sort select=$order-by order=ascending/.

But with this nothing happens and all other forms I tried also failed.

Does anyone know how to work this?

Thanks a lot

Axel

-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: XSL-question: sort with parameter

2002-03-26 Thread KOZLOV Roman

Hi Axel,

You can use something like following:

  xsl:sort select=child::node()[name()=$order]/

Best regards
Roman



Axel Honfi wrote:

 Hi!

 I passed a parameter to a stylesheet and I can get the value with
 xsl:value-of select=$order-by/.

 But I need to sort data by the value of the parameter like

 xsl:sort select=$order-by order=ascending/.

 But with this nothing happens and all other forms I tried also failed.

 Does anyone know how to work this?

 Thanks a lot

 Axel

 -
 Please check that your question has not already been answered in the
 FAQ before posting. http://xml.apache.org/cocoon/faqs.html

 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: XSL-question: sort with parameter

2002-03-26 Thread Bartomeu Adrover

It's not a very good solution if you have a lot of values for sort,
because you need to put one xsl:if tag for any possible value.

?xml version=1.0 encoding=ISO-8859-1?
xsl:stylesheet version=1.0
xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
 xsl:parameter name = sort/

 xsl:template match=/HELLO
  xsl:if test = $sort='@K'
   xsl:apply-templates select=GOODMORNING 
 xsl:sort select=@K/
  /xsl:apply-templates
  /xsl:if
  xsl:if test = $sort='@H'
   xsl:apply-templates select=GOODMORNING 
 xsl:sort select=@H/
  /xsl:apply-templates
  /xsl:if
 /xsl:template

 xsl:template match=GOODMORNING
  xsl:value-of select=./
 /xsl:template
/xsl:stylesheet


Axel Honfi wrote:

 Hi!

 I passed a parameter to a stylesheet and I can get the value with
 xsl:value-of select=$order-by/.

 But I need to sort data by the value of the parameter like

 xsl:sort select=$order-by order=ascending/.

 But with this nothing happens and all other forms I tried also failed.

 Does anyone know how to work this?

 Thanks a lot

 Axel

 -
 Please check that your question has not already been answered in the
 FAQ before posting. http://xml.apache.org/cocoon/faqs.html

 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


begin:vcard 
n:Adrover;Bartomeu
x-mozilla-html:FALSE
org:UIB;Servei de Càlcul i Informatizació
version:2.1
email;internet:[EMAIL PROTECTED]
adr;quoted-printable:;;Edifici Anselm Turmeda, Campus de la UIB=0D=0ACarretera de Valldemossa Km 7,5 ;Palma de Mallorca;Illes Balears;07071;Espanya
fn:Baromeu Adrover
end:vcard



-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]