cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Salvetti <m...@notremanou.net>
Subject Re: date in XSL
Date Tue, 11 Jan 2005 05:58:10 GMT
What you can do is use a simple xsp :

<!--sitemap.xmap-->
     <map:match pattern="dateToday">
        <map:generate type="serverpages" src="logicsheets/dateToday.xsp"/>
        <map:serialize type="xml"/>
     </map:match>

<!--dateToday.xsp-->
<?xml version="1.0"?>
<xsp:page xmlns:xsp="http://apache.org/xsp">
 <xsp:logic> java.util.Calendar today = 
java.util.Calendar.getInstance(); </xsp:logic>
  <today>
    <year>
        <xsp:expr>today.get(java.util.Calendar.YEAR)</xsp:expr>
    </year>
    <month>
        <xsp:expr>today.get(java.util.Calendar.MONTH) + 1</xsp:expr>
    </month>
    <day>
        <xsp:expr>today.get(java.util.Calendar.DAY_OF_MONTH)</xsp:expr>
    </day>
  </today>
</xsp:page>

regards,

Marc
Adriano Smith a écrit :

>Is it possible to display the current date and time using XSL ?
>  
>
> <http://ads.sify.com/RealMedia/ads/click_nx.ads/mail.sify.com/sentmail@Bottom>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message