Hi,
I'm very new to Jibx and I'm having a little problem when I try to access the XMLWriter so as I can declare a DTD. My code is below:
1 - IBindingFactory bfact = BindingDirectory.getFactory(rootObject.getClass());
2 -
3 - IMarshallingContext mctx = bfact.createMarshallingContext();
4 - mctx.setIndent(3);
5 -
6 - DTDDefinition dtd = ...; (not null)
7 - mctx.getXmlWriter().writeDocType(dtd.getRootElementName(), dtd.getSystemID(), dtd.getPublicID(), null);
8 -
9 - mctx.marshalDocument(rootObject, "ISO-8859-1", null, xmlOut);
P.S.: 'rootObject' is the object i'm trying to write to a XML file.
But, on line 7 i'm getting a NullPointerException cause de XMLWriter is NULL!! Is there something wrong with my code????
Thanks a lot!
Expedito.
