[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] Current date?
On Wed, Apr 02, 2003 at 01:30:05PM +0200,
Rune Enggaard Lausen <rune@enggaard-lausen.dk> wrote
a message of 83 lines which said:
> If you are willing to rely on EXSLT support in the XSLT processor, you
> could do like I did in our XSL-FO customization layer. It works with
> Saxon and xsltproc. Don't know about Xalan.
On my Debian 3.0 box, Xalan 1.2 does not support EXSLT. Neither do
Transformiix or Sablotron. So, I changed your stylesheet a bit to
handle non-EXSLT processors in a better way.
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:date="http://exslt.org/dates-and-times"
version='1.0'>
<xsl:template match="text">
<!-- Other stuff here ... -->
<xsl:text> " Produced by </xsl:text>
<xsl:value-of select="system-property('xsl:vendor')"/>
<xsl:text> (</xsl:text>
<xsl:value-of select="system-property('xsl:vendor-url')"/>
<xsl:text>) </xsl:text>
<xsl:choose>
<xsl:when test="function-available('date:date-time')">
<xsl:text>" on </xsl:text>
<xsl:variable name="now" select="date:date-time()"/>
<xsl:value-of select="date:day-in-month($now)"/>
<xsl:text> </xsl:text>
<xsl:value-of select="date:month-name($now)"/>
<xsl:text> </xsl:text>
<xsl:value-of select="date:year($now)"/>
<xsl:text> </xsl:text>
<xsl:value-of select="date:hour-in-day($now)"/>
<xsl:text>:</xsl:text>
<xsl:value-of select="date:minute-in-hour($now)"/>
<xsl:text>:</xsl:text>
<xsl:value-of select="date:second-in-minute($now)"/>
<xsl:text> </xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>" Current date not found, your XSL processor
" does not support EXSLT <http://exslt.org/> extensions :-( </xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]