You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by bu...@apache.org on 2003/10/07 13:09:32 UTC

DO NOT REPLY [Bug 23648] New: - HTMLGenerator produces NullPointerException on HML-docs with XML-Declaration

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

HTMLGenerator produces NullPointerException  on HML-docs with 	XML-Declaration

           Summary: HTMLGenerator produces NullPointerException  on HML-docs
                    with  XML-Declaration
           Product: Cocoon 2
           Version: 2.1.2
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: sitemap components
        AssignedTo: dev@cocoon.apache.org
        ReportedBy: email@alfred-fuchs.de


Description and Patch:

Applying 
<map:generate type="html" src="sample.html"/>

to the file "sample.html":
<?xml version="1.0" encoding="ISO-8859-1"?>
<html>
</html>

produces:
Exception in HTMLGenerator.generate(): java.lang.NullPointerException

if the line: <?xml version="1.0" encoding="ISO-8859-1"?>
is removed, all is ok.


if I replace in in org.apache.cocoon.generation.HTMLGenerator#generate()

domStreamer.stream(doc);

with:

contentHandler.startDocument();
domStreamer.stream(doc.getDocumentElement());
contentHandler.endDocument();

all works fine.


Diff:

319a320
>             DOMStreamer domStreamer = new
DOMStreamer(this.contentHandler,this.lexicalHandler);
320a322,323
>             contentHandler.startDocument();
> 			
322,324d324
<                 DOMStreamer domStreamer = new
DOMStreamer(this.contentHandler,this.lexicalHandler);
< 
<                 contentHandler.startDocument();
330d329
<                 contentHandler.endDocument();
332,333c331
<                 DOMStreamer streamer = new
DOMStreamer(this.contentHandler,this.lexicalHandler);
<                 streamer.stream(doc);
---
>                 domStreamer.stream(doc.getDocumentElement());
334a333,334
> 			
>             contentHandler.endDocument();