vmote 2003/11/12 09:28:07 Modified: src/documentation/content/xdocs faq.xml fo.xml Log: add doc for using current date and time, and create an FAQ referencing it Revision Changes Path 1.40 +6 -0 xml-fop/src/documentation/content/xdocs/faq.xml Index: faq.xml =================================================================== RCS file: /home/cvs/xml-fop/src/documentation/content/xdocs/faq.xml,v retrieving revision 1.39 retrieving revision 1.40 diff -u -r1.39 -r1.40 --- faq.xml 12 Nov 2003 15:11:59 -0000 1.39 +++ faq.xml 12 Nov 2003 17:28:07 -0000 1.40 @@ -972,6 +972,12 @@ </p> </answer> </faq> + <faq id="xslt-current-date"> + <question>(XSLT) How can I use the current date and time in my document?</question> + <answer> + <p>See <link href="fo.html#xslt-date">Current Date and Time</link>.</p> + </answer> + </faq> </part> <part id="part-help"> <title>General suggestions. How to solve problems.</title> 1.9 +22 -1 xml-fop/src/documentation/content/xdocs/fo.xml Index: fo.xml =================================================================== RCS file: /home/cvs/xml-fop/src/documentation/content/xdocs/fo.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- fo.xml 12 Nov 2003 15:11:59 -0000 1.8 +++ fo.xml 12 Nov 2003 17:28:07 -0000 1.9 @@ -82,6 +82,27 @@ </p> </section> </section> + <section id="xslt"> + <title>XSLT Issues</title> + <section id="xslt-date"> + <title>Current Date and Time</title> + <p>XSL-FO does not currently have a function for retrieving the current date and time. +However, in some cases, XSLT can be used to place the current date and time into the XSL-FO document as it is generated.</p> + <p>One possibility is to use the <link href="http://exslt.org/date/index.html">exslt date and time extension</link>.</p> + <p>Another possibility is to use java or javascript (or perhaps some other language). +Here is an example, using java, that works with Xalan. First, create the appropriate namespace:</p> + <source><![CDATA[<xsl:stylesheet version="1.0" + ... + xmlns:java="http://xml.apache.org/xslt/java" exclude-result-prefixes="java" + ...]]></source> + <p>Next, use the java language to retrieve and format the current date and time. +Here is an example template:</p> + <source><![CDATA[<xsl:template match="TodaysDate"> + <xsl:value-of select="java:format(java:java.text.SimpleDateFormat.new +('MMMM d, yyyy, h:mm:ss a (zz)'), java:java.util.Date.new())"/> + </xsl:template>]]></source> + </section> + </section> <section id="xsl-fo"> <title>XSL-FO Issues</title> <section id="fo-center-vertical">
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]