Usage of @class and CSS stylesheets


About a month ago I wrote to the list, if it would be
reasonable to introduce "class" attributes and CSS stylesheets in
XSL-FO. I allow myself to copy and paste it here:

> I was wondering, why XSL-FO doesn't allow classes and style attributes
> in its elements. Of course, I'm aware that this is intended to be done
> by XSLT, but still it would be more simple for creating, editing and
> maintenance of the code, if there could be a central point that defines,
> e.g., the layout of all fo:block elements.
> So, and to pull a parallel to SVG, I think class and style attributes as
> well as a style element in the fo:layout-master-set are a useful and
> important extension, when it comes to XSL-FO 1.1 or 2.0.

Glen Mazza answered me ( ),
including some good points (especially that hardcoding the layout info
with every element has the effect of future proofness). Still, I'm not
convinced and would like to mention it on this list again.

His first argument, that XSL-FO and CSS are siblings, should make it
easier to include CSS, since every term of a CSS definition has just to
be translated in attributes. Second, the priority rules could be equal
to what is defined in SVG, where styling attributes (e.g.
font-family="Arial" ) stand beside @style (style="font-family:Arial")
and CSS commands. Software like FOP would additionally have to parse the
CSS stylesheet and overwrite the style commands, if necessary, similar
to what it does, when a child has other properties than its parent. Not
trivial it should though be feasible.

Best regards
Manuel Strehl

Received on Wednesday, 16 August 2006 07:44:50 UTC