Return-Path: Delivered-To: apmail-xml-cocoon-users-archive@xml.apache.org Received: (qmail 232 invoked by uid 500); 24 Jul 2002 14:49:05 -0000 Mailing-List: contact cocoon-users-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: cocoon-users@xml.apache.org Delivered-To: mailing list cocoon-users@xml.apache.org Received: (qmail 212 invoked from network); 24 Jul 2002 14:49:04 -0000 Message-ID: <02e701c23321$41741860$5e3965c1@ifb.interfacebusiness.de> From: "Jens Lorenz" To: References: <000501c2331e$2cc74ed0$7c15290a@goaltech.com> Subject: Re: language variable, date formatting Date: Wed, 24 Jul 2002 16:49:04 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N ----- Original Message ----- From: "Barbara Post" To: Sent: Wednesday, July 24, 2002 4:26 PM Subject: language variable, date formatting > Hello, Hi, > My xsl stylesheet needs to format a date using a locale or a language > variable that is stored in session (using SunRise portal). > > I wonder how I can do this. > > If I use an xsp to produce the portion of xml I need (date formatted > according to a specific locale), how can the xsp get the session attribute > since it is stored in sunRise context (or another one if I need to do so) ? It probably much easier to produce this via Java, than re-inventing Locale-specific Date formatting in XSLT. > My problem is : how to access the session attributes when using sunRise, to > use it in sitemap or xsp ? If I use getxml I would have to use DOM then, > right ? > > I was surprised that the raw new Date() does not use my > computer locale... (FR) but English one. Assuming you are using the XSP with Java, this gets translated into String.valueOf(new Date()) which in turn does nothing more than (new Date()).toString(). If you want this to be a localized String you have to call SimpleDateFormat.format(new Date()). This way you can also have a different Locale for each User (which is probably what you want). > Thanks for any clue. > > Barbara > Jens -- jens.lorenz at interface-projects dot de interface:projects GmbH \\|// Tolkewitzer Strasse 49 (o o) 01277 Dresden ~~~~oOOo~(_)~oOOo~~~~ Germany --------------------------------------------------------------------- Please check that your question has not already been answered in the FAQ before posting. To unsubscribe, e-mail: For additional commands, e-mail: