<util:format>
-----Urspr�ngliche Nachricht-----
Von: Canavaggio Guillaume ZFF PA-K
Gesendet: Mittwoch, 5. November 2003 16:06
An: '[EMAIL PROTECTED]'
Betreff: AW: Snippet insideHello John,Thank you for your kind answer.I doubt this snippet would ever work with Cocoon 2.1, although I found it here:I think this is more correct:<util:time format="hh:mm:ss"/>Otherwise, I want to show that logicsheets can be applied in sequence;I cannot get this example run properly:<util:time>
<util:time format><xsp-request:get-parameter name="format"/></util:format></util:time>without getting the following message:XSPObjectHelper.xspExpr(contentHandler,XSPUtil.formatDate(new Date(),//start error (lines 132-132) "String literal is not properly closed by a double-quote"String.valueOf("//End error").trim()));This is the concerned section in util.xsl:<!-- Date -->
<xsl:template match="util:time">
<xsl:variable name="format">
<xsl:choose>
<xsl:when test="@format">"<xsl:value-of select="@format"/>"</xsl:when>
<xsl:when test="util:format">
<xsl:call-template name="get-nested-content">
<xsl:with-param name="content" select="util:format"/>
</xsl:call-template>
</xsl:when>
</xsl:choose>
</xsl:variable>
<xsp:expr>
XSPUtil.formatDate(new Date(),
String.valueOf(<xsl:copy-of select="$format"/>).trim())
</xsp:expr>
</xsl:template>And this is the get-nested-content template from logicsheet-util.xsl<xsl:template name="get-nested-content">
<xsl:param name="content"/>
<xsl:choose>
<xsl:when test="$content/xsp:text">"<xsl:value-of select="$content"/>"</xsl:when>
<xsl:when test="$content/*">
<xsl:apply-templates select="$content/*"/>
</xsl:when>
<xsl:otherwise><xsl:value-of select="$content"/></xsl:otherwise>
</xsl:choose>
</xsl:template>Generally speaking, I don't think it is a good idea to copy-paste outdated examples: it is doing no good for the "image" of the product and its dev community.And please do something about the util stylesheet: there is no other means to find out how it works than trying to read the XSL code.Kind regards,Guillaume-----Urspr�ngliche Nachricht-----
Von: Grange, John [mailto:[EMAIL PROTECTED]
Gesendet: Mittwoch, 5. November 2003 15:27
An: '[EMAIL PROTECTED]'
Betreff: RE: Snippet insidesurely it inserts into your output a string which contains the current date/time, formatted according to the contents of the "time-formt" parameter in the request. If that parameter is not available, it will be formatted using the "hh:mm:ss" format string.
John Grange
Software Team LeaderTel: +44 (0) 1749 834922
Email: [EMAIL PROTECTED]
BlueFinger Limited
Underwood Business Park, Wookey Hole Road, Wells, Somerset, BA5 1AF, UK
Tel: +44 (0) 1749 834900
Fax: +44 (0) 1749 834902
Mobile: +44 (0) 7876 038058
web: www.bluefinger.com <http://www.bluefinger.com>Company Reg No: 4209395 Registered Office: 2 Temple Back East, Temple Quay, BRISTOL. BS1 6EG.
*** This E-mail contains confidential information for the addressee only. If you are not the intended recipient, please notify us immediately. You should not use, disclose, distribute or copy this communication if received in error. No binding contract will result from this e-mail until such time as a written document is signed on behalf of the company. BlueFinger Limited cannot accept responsibility for the completeness or accuracy of this message as it has been transmitted over public networks.***
> -----Original Message-----
> From: Canavaggio Guillaume ZFF PA-K
> [mailto:[EMAIL PROTECTED]]
> Sent: 05 November 2003 13:27
> To: Cocoon users
> Subject: Snippet inside
>
>
> Hello,
>
> I am not certain to interpret correctly what this code
> snippet is supposed
> to do:
>
> <xsp:expr>
> SimpleDateFormat.getInstance().format(
> new Date(),
> XSPRequestHelper.getParameter("time-formt",
> "hh:mm:ss")
> )
> </xsp:expr>
>
> Mit freundlichen Gruessen/Kind regards/Cordialement
>
> Guillaume Canavaggio
>
> Informatik Vorentwicklung (IV) / Advance IT Development
> ZF Friedrichshafen AG, D-88038 Friedrichshafen, Germany
> Tel.: +49 / 0/ 7541 77- 3950
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
