I'm not sure, yet, if it's so easily possible to get the TransformerFactory from the FopFactory as it's not available everywhere. This could take some additional wiring. At first I was simply thinking about a classloader-wide setting (i.e. static variable) plus a system property. After all, it's not just FOP that instantiates Transformers, but XML Graphics Commons and Batik, too. I'll look into it.
On 31.01.2008 00:11:43 Andreas Delmelle wrote: > On Jan 30, 2008, at 13:01, Jeremias Maerki wrote: > > Hi Jeremias, Vincent, > > > <snip /> > > However, there's one thing in this context that is still on my list > > and > > that I want to change eventually: We have multiple places where we > > create a new TransformerFactory. It's always the platform default that > > is used. Some FOP users have asked before that there be a default that > > is set to and applies to FOP only, i.e. we need a central > > SAXTransformerFactory for FOP. > > I agree with the intention, but not with duplicating the endorsed > standards mechanism, as noted in the other thread. > The context where this is applicable, is not really simple CLI-usage, > so my reasoning would be: > If an embedding user needs to instantiate the basic > TransformerFactory himself, FOP should probably simply keep a > reference to that, and use that single factory internally. > > For example, a user could decide to force a hard dependency on Saxon: > > SAXTransformerFactory tFactory = (SAXTransformerFactory) > net.sf.saxon.TransformerFactoryImpl.newInstance() > > If we make it possible for him to pass this factory into the > FopFactory or FOUserAgent, and we replace all internal references to > TransformerFactory to use this instance, that should provide him with > more than enough flexibility. <snip/> Jeremias Maerki