DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18376>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18376

XSLTC errors when in template with date-time functions

           Summary: XSLTC errors when in template with date-time functions
           Product: XalanJ2
           Version: CurrentCVS
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Minor
          Priority: Other
         Component: org.apache.xalan.xsltc
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


Input stylesheet:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
 version="1.0"
 xmlns:foxy="http://foxyshadis.dyndns.org";
 xmlns:dt="http://exslt.org/dates-and-times";
 xmlns:str="http://exslt.org/strings";
 exclude-result-prefixes="str foxy dt"
>

<xsl:template match="/">
<html>
<body>
<xsl:call-template name="foxy:h12-mm-ap">
 <xsl:with-param name="date" select="dt:time('2001-01-01T12:00:00')"/>
</xsl:call-template>
</body>
</html>
</xsl:template>

<xsl:template name="foxy:h12-mm-ap">
<xsl:param name="date" select="dt:date-time()"/>
<xsl:variable name="h" select="dt:hour-in-day($date)"/>
<xsl:variable name="min" select="dt:minute-in-hour($date)"/>
<xsl:variable name="hour"><xsl:choose>
 <xsl:when test="$h&gt;12"><xsl:value-of select="$h - 12"/></xsl:when>
 <xsl:otherwise><xsl:value-of select="$h"/></xsl:otherwise>
</xsl:choose></xsl:variable>
<xsl:variable name="ampm"><xsl:choose>
 <xsl:when test="$h&gt;12">pm</xsl:when>
 <xsl:otherwise>am</xsl:otherwise></xsl:choose>
</xsl:variable>
<xsl:value-of select="concat($hour,':')"/>
<xsl:call-template name="foxy:padnum">
 <xsl:with-param name="num" select="$min"/>
 <xsl:with-param name="padding" select="'2'"/>
</xsl:call-template>
<xsl:value-of select="concat(' ',$ampm)"/>
</xsl:template>

<xsl:template name="foxy:padnum">
<xsl:param name="num"/>
<xsl:param name="padding"/>
<xsl:value-of select="str:align(string($num),
       str:padding($padding,'0'),'right')"/>
</xsl:template>
</xsl:stylesheet>

Commend strings:
java org.apache.xalan.xslt.Process -xsl 
c:/fox/text/foxy/journal/test-problem-1.xsl
java org.apache.xalan.xsltc.cmdline.Compile -o xjournal_xsltc -x -u
file:///c:/fox/text/foxy/journal/test-problem-1.xsl

Ouput of Xalan:
<html>
<body>12:00 am</body>
</html>

Output of XSLTC:
Compiler errors:
  null

Doesn't matter if it's called with dt:time() or not. (I use that because I ran 
into a problem calling it without it in Xalan, however, I can only replicate it 
with my full stylesheet and xml input document chain, so I'll leave that for 
later.) Commenting out the foxy:h12-mm-ap template and all calls to it works 
fine. No extra information, so it's probably a non-descriptive try-catch block.

Reply via email to