AW: date translation

2003-01-31 Thread Scherler, Thorsten
xsl:value-of select=translate($your-date, '/', '.') /

Would be if only I
need to change all the '/' into '.'

-Ursprüngliche Nachricht-
Von: Konstantin Piroumian [mailto:[EMAIL PROTECTED]]
Gesendet: Freitag, 31. Januar 2003 08:57
An: [EMAIL PROTECTED]
Betreff: Re: date translation


Yes, that's it.

Another option could be to use the XSLT translate() function if you only
need to change all the '/' into '.' in your date string:

xsl:value-of select=translate($your-date, '/', '.') /.

This way you can do it in XSLT.

--
  Konstantin

- Original Message -
From: Scherler, Thorsten [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, January 30, 2003 20:28
Subject: AW: date translation


Thanks!

I found:
http://xml.apache.org/cocoon1/xsp.html


-Ursprüngliche Nachricht-
Von: Joerg Heinicke [mailto:[EMAIL PROTECTED]]
Gesendet: Donnerstag, 30. Januar 2003 17:57
An: [EMAIL PROTECTED]
Betreff: Re: date translation


Only a comment:

Using

xsl:param name=any
 xsl:value-of select=anyExpression/
/xsl:param

is mostly not the optimum. It will create a Result Tree Fragment, where
it is not needed. Using

xsl:param name=any select=anyExpression/

is shorter and is of a normal data type like node set, string or
number. While working with strings it's only a question of conversions
the processor has to do. But when working with node sets it can be
really a problem:

xsl:param name=any
 xsl:copy-of select=anyExpressionThatReturnsANodeset/
/xsl:param

You can't operate on $any like on a node set. Only string operatrions
are allowed. So for example $any/path/to/a/node is not possible.

Another problem:

xsl:variable name=emptyString select=''/

xsl:variable name=emptyRTF
   xsl:value-of select=''/
/xsl:variable

xsl:if test=$emptyString/  == false
xsl:if test=$emptyRTF/ == true

You can't test that simply on the emptyness of a RTF, because it returns
always true. You must explicitely convert it into a string via
test=string($emptyRTF).

http://www.w3.org/TR/xslt#section-Result-Tree-Fragments

So in general it's better to avoid RTFs.

Regards,

Joerg

Scherler, Thorsten wrote:
 Hello group,

 if anybody need a date translation, here it is:

 e.g. test.html?date=29.1.2003 (like we write in Germany) will be
1/29/2003.

 xsl:param name=date/
 xsl:param name=GETdayxsl:value-of
select=substring-before($date,'.')/ /xsl:param
 xsl:param name=GETmonth_yearxsl:value-of
select=substring-after($date,'.')//xsl:param
 xsl:param name=GETmonthxsl:value-of
select=substring-before($GETmonth_year,'.')/ /xsl:param
 xsl:param name=GETyearxsl:value-of
select=substring-after($GETmonth_year,'.')/ /xsl:param
 ...
 xsl:value-of select=$GETmonth//xsl:value-of
select=$GETday//xsl:value-of select=$GETyear/

 King regards


Mit freundlichem Gruss,

Thorsten Scherler


-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.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/faq/index.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/faq/index.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/faq/index.html

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




date translation

2003-01-30 Thread Scherler, Thorsten
Hello group,

if anybody need a date translation, here it is:

e.g. test.html?date=29.1.2003 (like we write in Germany) will be 1/29/2003.

xsl:param name=date/
xsl:param name=GETdayxsl:value-of select=substring-before($date,'.')/ 
/xsl:param
xsl:param name=GETmonth_yearxsl:value-of 
select=substring-after($date,'.')//xsl:param
xsl:param name=GETmonthxsl:value-of 
select=substring-before($GETmonth_year,'.')/ /xsl:param
xsl:param name=GETyearxsl:value-of select=substring-after($GETmonth_year,'.')/ 
/xsl:param
...
xsl:value-of select=$GETmonth//xsl:value-of select=$GETday//xsl:value-of 
select=$GETyear/

King regards

 Mit freundlichem Gruss,
 
 Thorsten Scherler
 Marketing / Telefonmarketing
 
 Weidmüller GmbH  Co.
 P.O. Box 2807
 33058 Paderborn
 Tel.:+ 49 - 5252-960-350
 Fax:+ 49 - 5252-960-116
 eMail: [EMAIL PROTECTED]
 http://www.weidmueller.de
 
 

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

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




AW: date translation

2003-01-30 Thread Scherler, Thorsten
it is me again.

How can I do it with xsp?

-Ursprüngliche Nachricht-
Von: Scherler, Thorsten 
Gesendet: Donnerstag, 30. Januar 2003 16:22
An: Cocoon-Users (E-Mail)
Betreff: date translation


Hello group,

if anybody need a date translation, here it is:

e.g. test.html?date=29.1.2003 (like we write in Germany) will be 1/29/2003.

xsl:param name=date/
xsl:param name=GETdayxsl:value-of select=substring-before($date,'.')/ 
/xsl:param
xsl:param name=GETmonth_yearxsl:value-of 
select=substring-after($date,'.')//xsl:param
xsl:param name=GETmonthxsl:value-of 
select=substring-before($GETmonth_year,'.')/ /xsl:param
xsl:param name=GETyearxsl:value-of select=substring-after($GETmonth_year,'.')/ 
/xsl:param
...
xsl:value-of select=$GETmonth//xsl:value-of select=$GETday//xsl:value-of 
select=$GETyear/

King regards

 Mit freundlichem Gruss,
 
 Thorsten Scherler
 Marketing / Telefonmarketing
 
 Weidmüller GmbH  Co.
 P.O. Box 2807
 33058 Paderborn
 Tel.:+ 49 - 5252-960-350
 Fax:+ 49 - 5252-960-116
 eMail: [EMAIL PROTECTED]
 http://www.weidmueller.de
 
 

-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.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/faq/index.html

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




Re: date translation

2003-01-30 Thread Konstantin Piroumian
Please tell us what is the final target of your date translation and we'll
try to advice something.
In XSP you do it just the same way as in pure Java:
xsp:logic
   // perform your date translation using any method you like, e.g.
SimpleDateFormat.parse(), etc.
/xsp:logic

--
  Konstantin

- Original Message -
From: Scherler, Thorsten [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, January 30, 2003 18:28
Subject: AW: date translation


it is me again.

How can I do it with xsp?

-Ursprüngliche Nachricht-
Von: Scherler, Thorsten
Gesendet: Donnerstag, 30. Januar 2003 16:22
An: Cocoon-Users (E-Mail)
Betreff: date translation


Hello group,

if anybody need a date translation, here it is:

e.g. test.html?date=29.1.2003 (like we write in Germany) will be 1/29/2003.

xsl:param name=date/
xsl:param name=GETdayxsl:value-of
select=substring-before($date,'.')/ /xsl:param
xsl:param name=GETmonth_yearxsl:value-of
select=substring-after($date,'.')//xsl:param
xsl:param name=GETmonthxsl:value-of
select=substring-before($GETmonth_year,'.')/ /xsl:param
xsl:param name=GETyearxsl:value-of
select=substring-after($GETmonth_year,'.')/ /xsl:param
...
xsl:value-of select=$GETmonth//xsl:value-of
select=$GETday//xsl:value-of select=$GETyear/

King regards

 Mit freundlichem Gruss,

 Thorsten Scherler
 Marketing / Telefonmarketing

 Weidmüller GmbH  Co.
 P.O. Box 2807
 33058 Paderborn
 Tel.:+ 49 - 5252-960-350
 Fax:+ 49 - 5252-960-116
 eMail: [EMAIL PROTECTED]
 http://www.weidmueller.de



-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.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/faq/index.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/faq/index.html

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




AW: date translation

2003-01-30 Thread Scherler, Thorsten
Hello Konstantin,

I want to do the following:

I produce reports from a database. 
e.g.
esql:query
select * from info_bericht  where Info_datum = #xsp-request:get-parameter 
name=date/#   AND country ='xsp-request:get-parameter name=GETcountry/'
/esql:query

This is be done from a html form.
e.g.
form action=IDC2/info_int.pdf
select name=GETcountry
optgroup label=Lauml;nder
option value=FranceFrance/option
option value=ItalyItaly/option
option value=NetherlandNetherland/option
option value=SwissSwiss/option
/optgroup
/select
input type=text name=date
input type=submit
/form

The actual date of the esql:query/  has to be in the format e.g. 01/29/2003, but we 
are a company in Germany were we use this date format: 29.01.2003.

So I would like to translate the 29.01.2003 into 01/29/2003 before I put it in the 
esql:query/.

SimpleDateFormat.parse() will do the job? I will try!
 
xsp:logic
   // perform your date translation using any method you like, e.g.
SimpleDateFormat.parse(), etc.
/xsp:logic

Thanks a million!

-Ursprüngliche Nachricht-
Von: Konstantin Piroumian [mailto:[EMAIL PROTECTED]]
Gesendet: Donnerstag, 30. Januar 2003 16:34
An: [EMAIL PROTECTED]
Betreff: Re: date translation


Please tell us what is the final target of your date translation and we'll
try to advice something.
In XSP you do it just the same way as in pure Java:
xsp:logic
   // perform your date translation using any method you like, e.g.
SimpleDateFormat.parse(), etc.
/xsp:logic

--
  Konstantin

- Original Message -
From: Scherler, Thorsten [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, January 30, 2003 18:28
Subject: AW: date translation


it is me again.

How can I do it with xsp?

-Ursprüngliche Nachricht-
Von: Scherler, Thorsten
Gesendet: Donnerstag, 30. Januar 2003 16:22
An: Cocoon-Users (E-Mail)
Betreff: date translation


Hello group,

if anybody need a date translation, here it is:

e.g. test.html?date=29.1.2003 (like we write in Germany) will be 1/29/2003.

xsl:param name=date/
xsl:param name=GETdayxsl:value-of
select=substring-before($date,'.')/ /xsl:param
xsl:param name=GETmonth_yearxsl:value-of
select=substring-after($date,'.')//xsl:param
xsl:param name=GETmonthxsl:value-of
select=substring-before($GETmonth_year,'.')/ /xsl:param
xsl:param name=GETyearxsl:value-of
select=substring-after($GETmonth_year,'.')/ /xsl:param
...
xsl:value-of select=$GETmonth//xsl:value-of
select=$GETday//xsl:value-of select=$GETyear/

King regards

 Mit freundlichem Gruss,

 Thorsten Scherler
 Marketing / Telefonmarketing

 Weidmüller GmbH  Co.
 P.O. Box 2807
 33058 Paderborn
 Tel.:+ 49 - 5252-960-350
 Fax:+ 49 - 5252-960-116
 eMail: [EMAIL PROTECTED]
 http://www.weidmueller.de



-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.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/faq/index.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/faq/index.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/faq/index.html

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




Re: date translation

2003-01-30 Thread Joerg Heinicke
Only a comment:

Using

xsl:param name=any
xsl:value-of select=anyExpression/
/xsl:param

is mostly not the optimum. It will create a Result Tree Fragment, where 
it is not needed. Using

xsl:param name=any select=anyExpression/

is shorter and is of a normal data type like node set, string or 
number. While working with strings it's only a question of conversions 
the processor has to do. But when working with node sets it can be 
really a problem:

xsl:param name=any
xsl:copy-of select=anyExpressionThatReturnsANodeset/
/xsl:param

You can't operate on $any like on a node set. Only string operatrions 
are allowed. So for example $any/path/to/a/node is not possible.

Another problem:

xsl:variable name=emptyString select=''/

xsl:variable name=emptyRTF
  xsl:value-of select=''/
/xsl:variable

xsl:if test=$emptyString/  == false
xsl:if test=$emptyRTF/ == true

You can't test that simply on the emptyness of a RTF, because it returns 
always true. You must explicitely convert it into a string via 
test=string($emptyRTF).

http://www.w3.org/TR/xslt#section-Result-Tree-Fragments

So in general it's better to avoid RTFs.

Regards,

Joerg

Scherler, Thorsten wrote:
Hello group,

if anybody need a date translation, here it is:

e.g. test.html?date=29.1.2003 (like we write in Germany) will be 1/29/2003.

xsl:param name=date/
xsl:param name=GETdayxsl:value-of select=substring-before($date,'.')/ /xsl:param
xsl:param name=GETmonth_yearxsl:value-of select=substring-after($date,'.')//xsl:param
xsl:param name=GETmonthxsl:value-of select=substring-before($GETmonth_year,'.')/ /xsl:param
xsl:param name=GETyearxsl:value-of select=substring-after($GETmonth_year,'.')/ /xsl:param
...
xsl:value-of select=$GETmonth//xsl:value-of select=$GETday//xsl:value-of select=$GETyear/

King regards



Mit freundlichem Gruss,

Thorsten Scherler



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

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




Re: date translation

2003-01-30 Thread Konstantin Piroumian
Yes, that's it.

Another option could be to use the XSLT translate() function if you only
need to change all the '/' into '.' in your date string:

xsl:value-of select=translate($your-date, '/', '.') /.

This way you can do it in XSLT.

--
  Konstantin

- Original Message -
From: Scherler, Thorsten [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, January 30, 2003 20:28
Subject: AW: date translation


Thanks!

I found:
http://xml.apache.org/cocoon1/xsp.html


-Ursprüngliche Nachricht-
Von: Joerg Heinicke [mailto:[EMAIL PROTECTED]]
Gesendet: Donnerstag, 30. Januar 2003 17:57
An: [EMAIL PROTECTED]
Betreff: Re: date translation


Only a comment:

Using

xsl:param name=any
 xsl:value-of select=anyExpression/
/xsl:param

is mostly not the optimum. It will create a Result Tree Fragment, where
it is not needed. Using

xsl:param name=any select=anyExpression/

is shorter and is of a normal data type like node set, string or
number. While working with strings it's only a question of conversions
the processor has to do. But when working with node sets it can be
really a problem:

xsl:param name=any
 xsl:copy-of select=anyExpressionThatReturnsANodeset/
/xsl:param

You can't operate on $any like on a node set. Only string operatrions
are allowed. So for example $any/path/to/a/node is not possible.

Another problem:

xsl:variable name=emptyString select=''/

xsl:variable name=emptyRTF
   xsl:value-of select=''/
/xsl:variable

xsl:if test=$emptyString/  == false
xsl:if test=$emptyRTF/ == true

You can't test that simply on the emptyness of a RTF, because it returns
always true. You must explicitely convert it into a string via
test=string($emptyRTF).

http://www.w3.org/TR/xslt#section-Result-Tree-Fragments

So in general it's better to avoid RTFs.

Regards,

Joerg

Scherler, Thorsten wrote:
 Hello group,

 if anybody need a date translation, here it is:

 e.g. test.html?date=29.1.2003 (like we write in Germany) will be
1/29/2003.

 xsl:param name=date/
 xsl:param name=GETdayxsl:value-of
select=substring-before($date,'.')/ /xsl:param
 xsl:param name=GETmonth_yearxsl:value-of
select=substring-after($date,'.')//xsl:param
 xsl:param name=GETmonthxsl:value-of
select=substring-before($GETmonth_year,'.')/ /xsl:param
 xsl:param name=GETyearxsl:value-of
select=substring-after($GETmonth_year,'.')/ /xsl:param
 ...
 xsl:value-of select=$GETmonth//xsl:value-of
select=$GETday//xsl:value-of select=$GETyear/

 King regards


Mit freundlichem Gruss,

Thorsten Scherler


-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.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/faq/index.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/faq/index.html

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