CSS inaccuracy in Namespaces PR

This is a request for editorial change. It does not affect the technical
content of the XML namespaces specification, but corrects an inaccurate
reference to other W3C specifications (HTML and CSS).

In http://www.w3.org/TR/PR-xml-names#Philosophy it says:

> Another problematic area comes from the use of "global" attributes, as 
> illustrated by this example, a fragment of an XML
> document which is to be displayed using a CSS stylesheet: 
> 
>   <RESERVATION>
>    <NAME HTML:CLASS="largeSansSerif">Layman, A</NAME>
>    <SEAT CLASS="Y" HTML:CLASS="largeMonotype">33B</SEAT>
>    <DEPARTURE>1997-05-24T07:55:00+1</DEPARTURE></RESERVATION>
> 
> 
> In this case, the CLASS attribute, which describes the fare basis and takes 
> values such as "J", "Y", and "C", is distinct at all
> semantic levels from the HTML:CLASS attribute, which is used to achieve 
> CSS formatting effects.

The HTML class attribute is quite distinct from CSS. It is used to
simulate syntactic richness in HTML, as a means of overcoming the
limited element repertoire by subclassing, and is thus rarely used in
XML. 

The HTML:CLASS atttibute would not by itself, achieve any CSS formatting
effects. In combination with a style sheet it could be used to trigger a
stylistic change:

.largeSansSerif { font-style: oblique }

but then so could any other attribute

SEAT[CLASS=Y] { font-style: oblique }

The example in the Proposed Recommendation may lead readers to believe
that 

a) The class attribute directly produces formatting, which it does not
b) That the class attribute is a prerequisite for CSS styling, which it
is not

Also, the element names in  XMLised HTML will be using lower case.

Suggested action: 

Remove the phrase "which is used to achieve CSS formatting effects".
Then either

A) use the HTML style attribute instead, which does cause the formatting
changes that are ascribed to the CLASS attribute. For instance, modify
the example as follows

<RESERVATION>
   <NAME HTML:style="font: 10pt/12pt sans-serif">Layman, A</NAME>
   <SEAT CLASS="Y" HTML:style="font: 14pt/16pt Monotype">33B</SEAT>
   <DEPARTURE>1997-05-24T07:55:00+1</DEPARTURE></RESERVATION>

or B), if hard-coding a style into an example is considered to be bad
practice (which it is, although no worse than using "largeSansSerif" and
"largeMonotype" as class names), use different values for the HTML:class
attribute (the attribute name should be in lower case)

or C) use a different example of attribute name clash, for example the
HTML:title attribute and a title attribute that takes Mr, Mrs, Miss etc.

--
Chris Lilley, W3C

Received on Monday, 30 November 1998 15:29:07 UTC