How can i print system date in my xsl fo document?

How can i print system date in my xsl fo document?

i want to display system date in my xsl-fo document(i mean in pdf document).

i am using only xsl.
and a formatter from antenna house?

can anybody know me how can i display system date in my pdf document.

i can use java script also.

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

I generate the xsl with fop (a framework of apache) and print the date like this...

// get the date and time of system
                      Calendar calendario = Calendar.getInstance();
                       String fecha =  calendario.getCalendar.DAY_OF_MONTH)         + "/" +
calendario.get(Calendar.MONTH) + "/" +
calendario.get(Calendar.YEAR) + ", " +
calendario.get(Calendar.HOUR_OF_DAY) + ":" +

//Print the variable fecha that contains the system date and time in the foot of the page

dos.writeBytes("<fo:static-content flow-name=\"pie_pagina\" >");
dos.writeBytes("<fo:table-column column-Width=\"100mm\"/>");
dos.writeBytes("<fo:table-column column-width=\"95mm\"/>");
dos.writeBytes(" <fo:table-body>");
dos.writeBytes(" <fo:table-row>");
dos.writeBytes(" <fo:table-cell >");
dos.writeBytes("<fo:block font-weight=\"bold\" font-size=\"6pt\"  space-before.optimum=\"10pt\" text-align=\"start\">Fecha: " + fecha + "</fo:block>");                
dos.writeBytes(" </fo:table-cell >");
dos.writeBytes(" <fo:table-cell >");
dos.writeBytes(" <fo:block font-weight=\"bold\" font-size=\"6pt\"  space-before.optimum=\"10pt\" text-align=\"end\">Hoja <fo:page-number/> de <fo:page-number-citation ref-id=\"fin_docto\"/></fo:block>");              
dos.writeBytes("                                               </fo:table-cell >");
dos.writeBytes("                                   </fo:table-row>");
dos.writeBytes("                       </fo:table-body>");
dos.writeBytes("            </fo:table>");


dos is a DataOutputStream

i hope it helps you!
sorry for double comment, that is code in java
assuming xslt transforms xml into xhtml, dirty way to do it on the client site would be to put something like this

<SPAN ID=ABC></SPAN><SCRIPT>setTimeout("ABC.innerText=Date()",1000)</SCRIPT>

in the plase where you wand the date in your xslt.

there are lot of ways for getting system date.

for example in ur xsl file:

<?xml version="1.0" encoding="UTF-16" ?>
<xsl:stylesheet version="1.0" xmlns:fo="" xmlns:xsl="" xmlns:ms="urn:schemas-microsoft-com:xslt"
<ms:script language="JScript" implements-prefix="sg">

function systemDate()
        var d = new Date();
        var date;
        date = d.getFullYear() + '-' + (d.getMonth() + 1)  + '-' + d.getDate();

and call it like form your template as:

<xsl:value-of select="sg:systemDate()" />

Hope it works.

kind regards

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Languages and Standards

From novice to tech pro — start learning today.