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 2002/10/02 08:36:34 UTC

DO NOT REPLY [Bug 13190] New: - Reading from XSLTInputSource with an ifstream stops prematurely

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

Reading from XSLTInputSource with an ifstream stops prematurely

           Summary: Reading from XSLTInputSource with an ifstream stops
                    prematurely
           Product: XalanC
           Version: 1.4.x
          Platform: Macintosh
        OS/Version: MacOS 9
            Status: NEW
          Severity: Critical
          Priority: Other
         Component: XalanC
        AssignedTo: xalan-dev@xml.apache.org
        ReportedBy: freek.segers@contingo.nl


When using an XSLTInputSource that has an ifstream to read from, the underlying file is 
read only partly. The reason is that StdBinInputStream uses ifstream::readsome() to read 
from the stream. According to the C++ specification readsome() should only read from 
the internal buffer and return 0 if the buffer contains no more character to read.
In Metrowerks CodeWarrior (version 8.2) the ifstream implementation does exactly that.
Using ifstream::read() or calling ifstream::peek() before calling readsome() fixes the 
problem.