Please create a Jira and attach the files including input XML that works and 
breaks.

Gary

<div>-------- Original message --------</div><div>From: 
[email protected] </div><div>Date:04/30/2014  16:14  (GMT-05:00) 
</div><div>To: [email protected] </div><div>Subject: RE: FW: Date:Date 
throws IndexOutOfBounds Exception on empty input </div><div>
</div>Gary,
Yes, it produces the same error with 2.7.2

Thanks,
Philip Miess

From: Gary Gregory [mailto:[email protected]] 
Sent: Wednesday, April 30, 2014 3:55 PM
To: [email protected]
Subject: RE: FW: Date:Date throws IndexOutOfBounds Exception on empty input

Can you reproduce the error with version 2.7.2?

The site is not updated yet but the files are in the download directory. 

Gary

-------- Original message --------
From: [email protected] 
Date:04/30/2014 15:13 (GMT-05:00) 
To: [email protected] 
Subject: FW: Date:Date throws IndexOutOfBounds Exception on empty input 

xalan-dev,
Following the procedure on the bug reporting page 
(http://xalan.apache.org/xalan-j/bugreporting.html), 
I sent the following request about a possible bug to the j-users list for 
clarification. 
I have not received any reply to date.
If this is no longer the procedure, an update to that page is in order.

Would anyone care to comment about this potential bug on this list?

Thanks,
Philip Miess
_____________________________________________
From: Miess, Philip (TR Technology) 
Sent: Thursday, January 30, 2014 1:59 PM
To: '[email protected]'
Subject: Date:Date throws IndexOutOfBounds Exception on empty input


j-users,

When running the following XSL file Xalan-J 2.7.1 throws 
java.lang.StringIndexOutOfBoundsException: String index out of range: 0 - 
String index out of range: 0
As long as the root node does not have an attribute named "anAttribute".


Expected output is an single root node
https://xalan.apache.org/xalan-j/apidocs/org/apache/xalan/lib/ExsltDatetime.html#date(java.lang.String)
 indicates that it should produce an empty string instead of throwing
"If the argument is not in either of these formats, date:date returns an empty 
string ('')"
Saxon produces the expected output.

If the null check where moved to the start of the date function it world work 
as specified.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
    xmlns:exsl="http://exslt.org";
    xmlns:date="http://exslt.org/dates-and-times";
    extension-element-prefixes="date exsl"
    version="1.0">
    <xsl:template match="/">
        <xsl:element name="root">
            <xsl:value-of select="date:date(@anAttribute)"/>
        </xsl:element>
    </xsl:template>
</xsl:stylesheet>

Is this a bug? Should I write it up?
Thanks,
Philip Miess



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to