Tricky Exception with XML
Hello!I run this code:
public String getDocumentAsString(boolean includeInternalDTD) throws IOException, LibraryException
{
StringWriter sw = new StringWriter();
((TXDocument)_document).setPrintInternalDTD(includeInternalDTD);
((TXDocument)_document).printWithFormat(sw);
return(sw.toString());
}
I call it with: compiler.getDocumentAsString(true); and
compiler.getDocumentAsString(false);
And I allways get this error:
com.ibm.xml.parser.LibraryException: com.ibm.xml.parser.TXDocument#printWithForm
at(): Unexpected Exception: java.lang.NullPointerException
at com.ibm.xml.parser.TXDocument.printWithFormat(TXDocument.java)
at com.ibm.xml.parser.TXDocument.printWithFormat(TXDocument.java)
at com.my.test.xml.XMLCompiler.getDocumentAsString(XMLCompil
er.java:294)
Does any one understand why?
please help
