aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Victor Mote <vmote@apache.org>2003-11-12 17:28:07 +0000
committerWilliam Victor Mote <vmote@apache.org>2003-11-12 17:28:07 +0000
commitd1b8a80f3b8d573c78565b28dafd3c5667d51921 (patch)
tree0747b9a2a011b4093a46cc8a8edbaa82f052e6a4
parent2a1366555e374c715efdc8c51843e059b4b8be7a (diff)
downloadxmlgraphics-fop-d1b8a80f3b8d573c78565b28dafd3c5667d51921.tar.gz
xmlgraphics-fop-d1b8a80f3b8d573c78565b28dafd3c5667d51921.zip
add doc for using current date and time, and create an FAQ referencing it
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197008 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/documentation/content/xdocs/faq.xml6
-rw-r--r--src/documentation/content/xdocs/fo.xml21
2 files changed, 27 insertions, 0 deletions
diff --git a/src/documentation/content/xdocs/faq.xml b/src/documentation/content/xdocs/faq.xml
index 86a6b046f..38f081e36 100644
--- a/src/documentation/content/xdocs/faq.xml
+++ b/src/documentation/content/xdocs/faq.xml
@@ -972,6 +972,12 @@ Can I control this?</question>
</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>
diff --git a/src/documentation/content/xdocs/fo.xml b/src/documentation/content/xdocs/fo.xml
index 2b563da0b..583228293 100644
--- a/src/documentation/content/xdocs/fo.xml
+++ b/src/documentation/content/xdocs/fo.xml
@@ -82,6 +82,27 @@ If you view their output with something not aware of the encoding, like Notepad
</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">