JDK-8062924 : XSL: wrong answer from substring() function
  • Type: Bug
  • Component: xml
  • Sub-Component: jaxp
  • Affected Version: 6u65,9
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2014-11-05
  • Updated: 2016-08-26
  • Resolved: 2015-01-26
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6 JDK 7 JDK 8 JDK 9
6u101Fixed 7u80Fixed 8u45Fixed 9 b49Fixed
Related Reports
Relates :  
Description
XSL substring(value,start, length) function incorrectly process the -Inf length values (the -Inf is treated as Inf). 
Consider the following xsl code snippet:
|<xsl:value-of select="substring('asdf',2,-1 div 0)"/>|
It should return:
||
But the result is:
|sdf|
Comments
As far as the issues has been fixed with JDK-8062923 and the latter is approved, you have SQE OK for this one as well.
29-01-2015

Reopening, because the observed error differs from the error observed in JDK-8062923.
13-01-2015

The root cause of this issue that negative length values shouldn't be processed by the substring() XSL function and the empty string should be returned. In such case this bug is a duplicate of 8062923.
18-11-2014