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/07 13:28:41 UTC

DO NOT REPLY [Bug 4697] New: - XalanDefaultDocumentBuilder is not reusable

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

XalanDefaultDocumentBuilder is not reusable

           Summary: XalanDefaultDocumentBuilder is not reusable
           Product: XalanC
           Version: 1.2.x
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: XalanC
        AssignedTo: xalan-dev@xml.apache.org
        ReportedBy: edwin@poskanzer.org


A common usage pattern with SAX2-conformant parser is to install a content
handler when instantiating the parser object, then use the parser to parse
various input sources. 

Using the DocumentBuilder.cpp sample, this can be simulated by invoking
BuildDocument() function inside a loop:

for (i = 0; i < 100; i++) {
  BuildDocument(theBuilder);  
  theResult = theXalanTransformer.transform(*theBuilder, "foo.xsl", "foo.out");  
  cerr << "Loop no: " << i << "\n";
  if(theResult != 0) {
    cerr << "DocumentBuilder error: \n" << theXalanTransformer.getLastError() 
    << endl << endl;
  }
}

..which dumps core after the first loop.