• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

displaying current date/time in xsl

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 734
7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic