If you're trying to work with dates, you can use the java extensions in xalan. This way you can call any java stuff you need.

namespace to include:
xmlns:java="http://xml.apache.org/xslt/java";

<xsl:variable name="locale" select="java:java.util.Locale.new('nl','BE')"/> <!-- Class.new creates new instance -->
<xsl:variable name="currentCalendar" select="java:java.util.Calendar.getInstance($locale)"/> <!-- static factory method -->
<xsl:variable name="currentDate" select="java:getTime($currentCalendar)"/>
<xsl:variable name="dateFormat" select="java:java.text.DateFormat.getDateTimeInstance(java.text.DateFormat.MEDIUM, java.text.DateFormat.MEDIUM, $locale)"/>
<xsl:variable name="TimeStamp" select="java:format($dateFormat, $currentDate)"/> <!-- normal functions, first give object on which to perform the function, then arguments-->


Kind Regards,
Jan

gerritjan wrote:

Hello,

This XSLT:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
xmlns:date="http://exslt.org/dates-and-times";
extension-element-prefixes="date xsl" >
<xsl:import href="date.add.function.xsl" />
<xsl:output method="xml"/>
<xsl:param name="p_dagen_terug"/>

<xsl:template match="onderwerpen">
<xsl:variable name="d1"><xsl:value-of select="date:date()"/></xsl:variable>
<xsl:variable name="d2"><xsl:value-of select="substring-before ($d1, '+02:00')"/></xsl:variable>
<xsl:variable name="d5"><xsl:value-of select="date:date-add($d2,'-P50D')"/></xsl:variable>
<basis>
1
<xsl:value-of select="$d1"/>
2
<xsl:value-of select="$d2"/>
5
<xsl:value-of select="$d5"/>
</basis>
</xsl:template>



</xsl:stylesheet>

Gives this error;
org.apache.cocoon.ProcessingException: Failed to execute pipeline.: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.NullPointerException


I'm not sure if Xalan supports this EXSLT function natively , but with 'import' I was hoping to use this EXSLT function anyway
by the way: without the 'import' line I get the same error...
The 'imported' file is downloadable from www.exslt.org


*/_Gerritjan Koekkoek_/*



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to