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 2001/11/12 17:24:46 UTC

DO NOT REPLY [Bug 4813] New: - xsltc returns substring even when start and length args invalid

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

xsltc returns substring even when start and length args invalid

           Summary: xsltc returns substring even when start and length args
                    invalid
           Product: XalanJ2
           Version: 2.0.0
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Minor
          Priority: Other
         Component: org.apache.xalan.xsltc
        AssignedTo: xalan-dev@xml.apache.org
        ReportedBy: tom.amiro@sun.com


xsltc should probably agree with Xalan on this one. 
The test sets the start argument for the substring function 
to -1 div 0 and the length argument to 1 div 0. Since 
neither is valid, it would be better not to return anything --
although a very very low priority, seeing no one would ever do 
this in a million years.

Running xalan on string21
<?xml version="1.0" encoding="UTF-8"?>
<out/>


Running XSLTC with Xerces Parser on string21
<?xml version="1.0" encoding="UTF-8" ?>
<out>12345</out>

 glrr 230 =>cat string21.xsl
<?xml version="1.0"?> 
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

  <!-- FileName: str21 -->
  <!-- Document: http://www.w3.org/TR/xpath -->
  <!-- DocVersion: 19990922 -->
  <!-- Section: 4.2 String Functions -->
  <!-- Purpose: Test of 'substring()' function. -->

  <xsl:template match="doc">
    <out>
      <xsl:value-of select='substring("12345", -1 div 0, 1 div 0)'/>
    </out>
  </xsl:template>
 
</xsl:stylesheet>