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

ExsltDatetime hourInDay(String datetimeIn) does not work

           Summary: ExsltDatetime hourInDay(String datetimeIn) does not work
           Product: XalanJ2
           Version: 2.4
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: org.apache.xalan.lib
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


org.apache.xalan.lib.ExsltDatetime hourInDay(String datetimeIn) does not 
work...it always returns "0". According to the documentation, this method 
should support both xs:dateTime (CCYY-MM-DDThh:mm:ss) and xs:time (hh:mm:ss) 
formats. However, it actually supports neither.

I believe that this line:
String[] formats = {d, t};

Should be changed to this:
String[] formats = {dt, t};

This solves the xs:dateTime support problem, but there seems to be another bug 
when you try to use xs:time. This time, the error appears to be in the 
testFormats method. If you use the xs:time format, it throws an exception after 
the first parse attempt and never gets around to trying the correct format. I 
don't know what should be tested, but this line doesn't work...

if (pe.getErrorOffset() < in.length())

pe.getErrorOffset() is always less than in.length()

If I comment it out, it works.

Reply via email to