You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by bu...@apache.org on 2002/02/07 06:44:58 UTC

DO NOT REPLY [Bug 6297] New: - OutOfMemory error when parsing a non WF document with ByteArrayStream

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

OutOfMemory error when parsing a non WF document with ByteArrayStream

           Summary: OutOfMemory error when parsing a non WF document with
                    ByteArrayStream
           Product: Xerces2-J
           Version: 2.0.0
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: SAX
        AssignedTo: xerces-j-dev@xml.apache.org
        ReportedBy: eddie@allette.com.au


Hi,

I'm getting an OutOfMemoryError when parsing an XML document that has more than 
one root element when parsing is done using a ByteArrayStream. Here is my code:

// Text to parse
String text = "<Eddie/>\n<Eddie/>";
String fileName = "c:\temp\test.xml";

// Get an XMLReader instance
reader = 
XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser");
// Register the Error handler
reader.setErrorHandler(errorHandler);
// DTD Validation
reader.setFeature("http://xml.org/sax/features/validation", true);
reader.setFeature("http://apache.org/xml/features/continue-after-fatal-error", 
true);
// Create InputSource
InputSource inputSource = new InputSource(new 
ByteArrayInputStream(text.getBytes()));
inputSource.setSystemId(fileName);
reader.parse(inputSource); 


This will just keep going until I get an OutOfMemoryError. Is this a bug or am I 
doing something wrong?

Cheers,
/Eddie

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org