Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

displaying current date/time in xsl

 
Paula Allen
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm trying to find a way to display the current date. I found this code on this site and have tried it:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:java="http://xml.apache.org/xslt/java"
exclude-result-prefixes="java">
...
<xsl:value-of select="java:format(java:java.text.SimpleDateFormat.new('yyyy.MM.dd'), java:java.util.Date.new())" />
...
</xsl:stylesheet>

I'm using xslt 1 and stylesheet version 1 and translating to a pdf. I think it will work but my FO processor "can't find the script or external object that implements the prefix 'http://xml.apache.org/xslt/java'. I also tried the date-and-times extender and got similar results. What am I doing wrong? I also read something about third party extenders where you put in a line like <xsl:import href='date.xsl'> Hope someone can help.
Thank you, Paula
 
g tsuji
Ranch Hand
Posts: 669
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
...but my FO processor "can't find the script or external object that implements the prefix 'http://xml.apache.org/xslt/java'

The extension element/function is entirely implementation-dependent. So, basically, you should consult the documentation of "your" FO processor.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic