presentation pipeline [was] Re: [xsl] Landscape print control

Subject: presentation pipeline [was] Re: [xsl] Landscape print control
From: "Mike Haarman" <mhaarman@xxxxxxxxxxxxxxxxxx>
Date: Fri, 5 Sep 2003 09:41:47 -0500
From: "Andrew Welch" <AWelch@xxxxxxxxxxxxxxx>

> > > So do you maintain two completely separate stylesheets, one
> > > for html and one for pdf?  I'm about to do something similar
> > > and I can see issues where one has been updated without the
> > > other.  Is it simply the case when a change is required you
> > > have to make the change twice?
> >
> >
> > There are two ways of structuring this to achieve reuse between the
> two
> > transformations. One is to do a two-phase transformation in which the
> > first phase does all the work that is common. The other is to put all
> > the common code in a module that is imported into both the
> stylesheets.


> your html-producing stylesheet and a corresponding template in your
> fo-producing stylesheet, what happens when its decided the background
> should be red?
> How can we arrange it so that change from blue to red is made in one
> place rather than both stylesheets?

I actually adopt a bit of both the solutions Mr Kay mentions.  Pipeline a pair
of SAX transformations: first bringing data into an intermediate reporting
markup; second grabs one of two presentation stylesheets.  Both presentation
layer stylesheets include properties stylesheet which makes heavy use of
attribute-sets to group common layout properties.

Recall that attribute-sets can reference other attribute-sets in their
definition.  I build them up incrementally into high-level groups of properties
and can reference the atomic properties when necessary.

I actually include three properties stylesheets which provide application,
installation and user-group levels of properties.  Include precedence determines
which properties are applied when I ask for use-attribute-sets in the templates.
If a set is defined in properties.installation, it overrides the definition in
properties.application, etc.

In practice, having separated print and web views, the two began to diverge to
take advantage of their relative strengths.  I began by short-cutting the
client's print button and ended up creating a consistent, attractive print
reporting regime, but I can still change blue to red in one place without
blowing away a local installation's preference for green.

I think CSS can be used to manage aspects of this requirement, as well, since
CSS2 is a subset of FO properties, but I don't have experience with that route.


 XSL-List info and archive:

Current Thread