[jdom-interest] DOMOutputter and FOP

philip.nelson at omniresources.com philip.nelson at omniresources.com
Wed Apr 18 11:24:00 PDT 2001

> I'm already using JDOM to create data-bound HTML-Forms in two
> languages out of XML. In the following example I tried to
> create a pdf-file using one of the FOP-examples(simple.fo).
> When running it with "java org.apache.fop.apps.CommandLine
>  simple.fo simple.pdf" on the command line everything is fine,
> but using the Driver buildFOTree failes (NullPointerException).
> Seems to me that this method doesn't like the DOM created by
> the DOMOutputter of JDOM.

Could you send a stack trace?  I have no experience with FOP at all but it
may be useful.  If you could, another trouble shooting option would be to
build a DOM document from xerces directly and see if you get the same
results.  That would isolate what part of the code is the real problem.


> I tried to specify a DOMAdapter, but regardless of the fact 
> that I dont't
> know
> how such a string would look like (help!) the Compiler 
> doesn't let me use a
> string there anyway: wrong number of arguments in constructor.
> Anyone any idea?

So you were using the default, org.jdom.adapters.XercesDOMAdapter.  Replace
that string with another in the DOMOutputter constructor to try a different
adapator.  If FOP is actually getting the SVG dtd because of the line in
your code, I would try the crimson adaptor instead of xerces.  You will have
to download crimson of course from Sun (or is it an apache project now?).

More information about the jdom-interest mailing list