On Feb 27, 2008, at 16:21, Adrian Cumiskey wrote:

For either my suggestion or Andreas' further proposal we would certainly need to do a little bit of refactoring, abstracting out all those member config variables in FopFactory into a base configuration object. This base configuration object would be a singleton and *unmodifiable* and would only serve the function of providing the default fallback configuration settings

Yep, that's what I meant. The configuration of the FopFactory would only be used if there is no override at the level of the UserAgent/ Document (or even elsewhere?). It would indeed be immutable. The intention is not to mess with the settings here, but more to keep those settings, and *if* a user specifies overriding config-settings, to create a temporary config that provides the overrides.

A second user agent configuration object would be created per user agent, this configuration would be modifiable. The user agent configuration would derive configuration values from the base configuration when values were not provided programmatically through API on the fly. A third configuration object could represent the document level configuration. This would be created on construction of the FO tree and it would derive its default values from the user agent configuration which in turn would derive its values (in their absence) from the base configuration. Hope I explained how that would work clearly enough, does that make sense?

Yes it does, more or less. I hadn't really considered details yet, but I guess I'd see it as a stack of configurations, where the top of the stack is always consulted first. The FopFactory config would be the bottom.

This scoping seems a little bit too clever for me ;-).

Heh, I get that a lot... :-)

I'm not sure how useful this use case would be. I think its useful enough to just have a document level configuration defined within the fo:declarations.

Well, it could be handy if the user knows in advance, for example, that there is one block in the entire document where he has a table that does not adhere 100% to the XSL-FO Rec. Of course, we're all inclined to say that the stylesheet should be adapted in that case, but that is not always as easily said as it is done... Being able to override strict-validation for just one block would offer immediate relief, where changing the stylesheet could take multiple days or weeks, depending on who is the owner/maintainer.

Being able to override the base-url would probably at most be neat for the page-sequence level.

Bummer about the fo:declarations is that it always appears after the fo:layout-master-set, and some settings apply to the latter (page- width or -height fallback).


Cheers

Andreas

Reply via email to