Title: Help - NullPointerException with DocumentSource

Hi,

I am using dom4j-1.0 version.  I am trying to apply xsl template to the dom4j Document. 

I am getting the following error
java.lang.NullPointerException
        at org.dom4j.io.SAXWriter.write(SAXWriter.java:149)
        at org.dom4j.io.SAXWriter.writeContent(SAXWriter.java:410)
        at org.dom4j.io.SAXWriter.write(SAXWriter.java:505)
        at org.dom4j.io.SAXWriter.writeContent(SAXWriter.java:405)
        at org.dom4j.io.SAXWriter.write(SAXWriter.java:505)
        at org.dom4j.io.SAXWriter.writeContent(SAXWriter.java:405)
        at org.dom4j.io.SAXWriter.write(SAXWriter.java:505)
        at org.dom4j.io.SAXWriter.writeContent(SAXWriter.java:405)
        at org.dom4j.io.SAXWriter.write(SAXWriter.java:505)
        at org.dom4j.io.SAXWriter.writeContent(SAXWriter.java:405)
        at org.dom4j.io.SAXWriter.write(SAXWriter.java:505)
        at org.dom4j.io.SAXWriter.writeContent(SAXWriter.java:405)
        at org.dom4j.io.SAXWriter.write(SAXWriter.java:127)
        at org.dom4j.io.SAXWriter.parse(SAXWriter.java:387)
        at org.apache.xalan.transformer.TransformerImpl.transform(Unknown Source)
        at org.apache.xalan.transformer.TransformerImpl.transform(Unknown Source)
        at __jspPage1_login_jsp._jspService(__jspPage1_login_jsp.java:51)
        at com.orionserver.http.OrionHttpJspPage.service(Unknown Source)
        at com.evermind._ah._rad(Unknown Source)
        at com.evermind.server.http.JSPServlet.service(Unknown Source)
        at com.evermind._cxb._abe(Unknown Source)
        at com.evermind._cxb._uec(Unknown Source)
        at com.evermind._io._twc(Unknown Source)
        at com.evermind._io._gc(Unknown Source)
        at com.evermind._if.run(Unknown Source)

I saw in the mailing list that this NullPointer bug has been fixed.  My code is like the following, I am using this inside a JSP.

        Transformer transformer = TemplateCache.getTemplate("ItemsXsl");
        Document doc = new InterfaceGenerator().generate(2, false);
        transformer.transform(new DocumentSource(doc), new StreamResult(out));

For the trasform I am getting the NullPointer exception.  My document is a proper document if I write to a file using XMLWriter it writes properly to a file.

When I tried to run from sample console java program the same xml and xsl works properly. 

Is any step I am missing?

plase help me.

Thanks in advance.

Kesav Kumar Kolla
Voquette Inc
650 356 3740(W)
510 889 6840(R)
Voquette....Delivering Sound Information


Reply via email to