W3C home > Mailing lists > Public > www-xsl-fo@w3.org > July 2006

Re: Usage of @class and @style in XSL-FO

From: Glen Mazza <gmazza@apache.org>
Date: Fri, 14 Jul 2006 22:54:58 -0400
To: www-xsl-fo@w3.org
Message-id: <44B85902.2080008@apache.org>

I stand mistaken on my xml-compliance concern.  CSS declarations, even 
if embedded in SVG documents[1], use the CDATA structure, making them 
valid XML.

Some other comments I could add about this:

1.)  XSL and CSS are mostly sibling technologies, one primarily for 
styling book/paper like documents, the other for HTML (and SVG 
apparently).  But XSL concerns both objects to be rendered (headers, 
footers, flowing text etc.) *and* the styling of them.  CSS is primarily 
styling, and SVG is primarily objects (circles, trapezoids, etc.)  I 
think this is why CSS can be used with much less conflict or overlap 
with SVG than with XSL.

2.)  If you mixed CSS with XSL styling, the XSL Working Group would need 
to define resolution rules--which takes precedence, how a CSS value 
would effect XSL property inheritance, etc.  This might not be a trivial 
undertaking, and coding FOP or other processors to handle this might 
also take quite a bit of work.

3.)  The purpose of the xsl:attribute-sets/xsl:use-attribute-sets is to 
give the stylesheet author customization abilities and ease of 
maintenance similar to what you get with CSS.  However, after the XSLT 
transformation (i.e., replacement of all the xsl:use-attribute-sets with 
their corresponding properties on the FO), every formatting object has 
all of its properties hardcoded with it.  I think that's one purpose of 
XSL:  for any formatting object, all of its properties are declared with 
it and they cannot be externally adjusted.  It is a fixed, future-proof 
contract of the text a document is supposed to have *and* how it is 
supposed to look.*  If you allow a CSS stylesheet in the background to 
be able to modify that document's properties, then that contract becomes 
variable, it is no longer an normative, unchanging definition.  Perhaps 
not that big a deal, but just an issue to keep in mind.

BTW -- you may wish to send your proposal to xsl-editors@w3.org, for 
feedback from the XSL Working Group.

Glen

[1] http://www.w3.org/TR/SVG/styling.html#StylingWithCSS

* Exceptions being for fo:instream-foreign-object and 
fo:external-graphic, which could obviously change/be affected by CSS 
stylesheets, etc.

Glen Mazza wrote:
> 
> @class and @style do not appear to be xml-compliant.  A XML document in 
> the XSL FO namespace still needs to follow proper XML syntax.
> 
> I think the functionality you are looking for is supported by the 
> xsl:attribute-set and xsl:use-attribute-sets elements of XSLT, as 
> explained here:  http://xml.sys-con.com/read/40601.htm.
> 
> Glen
> 
> Manuel Strehl wrote:
> 
>> Hello.
>>
>> 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.
>>
>> Best regards
>> Manuel Strehl
>>
>>
>>
>>  
>>
> 
> 
> 
Received on Saturday, 15 July 2006 02:54:08 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 3 October 2007 16:06:13 GMT