You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by bu...@apache.org on 2003/01/24 10:14:16 UTC

DO NOT REPLY [Bug 16386] New: - xsltc Extension: multiple argument constructor (SimpleDateFormat(pattern,locale)) not accepted

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=16386>.
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=16386

xsltc Extension: multiple argument constructor (SimpleDateFormat(pattern,locale)) not accepted

           Summary: xsltc Extension: multiple argument constructor
                    (SimpleDateFormat(pattern,locale)) not accepted
           Product: XalanJ2
           Version: 2.4Dx
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: org.apache.xalan.xsltc
        AssignedTo: xalan-dev@xml.apache.org
        ReportedBy: stefan.kaesberg@avinci.de


The stylesheet part
...
<xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
xmlns:xalan="http://xml.apache.org/xalan"
xmlns:date="http://xml.apache.org/xalan/java/java.util.Date"
xmlns:dateFormat="http://xml.apache.org/xalan/java/java.text.SimpleDateFormat"
xmlns:locale="http://xml.apache.org/xalan/java/java.util.Locale"
xmlns:java_lang="http://xml.apache.org/xalan/java/java.lang"
exclude-result-prefixes ="date locale dateFormat java_lang xalan">
...
<xsl:variable name="dateObject" select="date:new()"/>
<xsl:variable name="localeObject" select="locale:new('fr','')"/>
<xsl:variable name="dateFormatObject" 
 select="dateFormat:new('dd. MMMM yyyy HH:mm:ss zzzz', $localeObject)"/>
<xsl:variable name="date-time" 
 select="dateFormat:format($dateFormatObject,$dateObject)"/>
...
produces the following Error:

ERROR:
'Cannot convert argument/return type in call to method
'java.text.SimpleDateFormat.new(string, object)''
javax.xml.transform.TransformerConfigurationException:
Could not compile stylesheet
at
org.apache.xalan.xsltc.trax.TransformerFactoryImpl.newTemplates
(TransformerFactoryImpl.java:662)

when it was parsed by xsltc to create a Templates Object.
With Xalan it works fine.