Re: Shouldn't style be xml:style or xstyle:style ?

On Fri, 27 Oct 2000, Eric van der Vlist wrote:
>
> In your WG "Syntax of CSS rules in HTML's "style" attribute" [1], you
> are mentioning that:
> 
> "This document recommends that any future XML based languages which have
> presentational information (whether visual, aural, tactile or other)
> also add a STYLE attribute which similarly permits the user to use CSS
> to style the document and elements in documents written in that
> language."
> 
> The 'style' attribute already existing in XHTML, SVG, MathML, ...
> doesn't specify any namespace and has, since the default namespace
> doesn't apply to attributes, no namespace.

No. It doesn't have no namespace. An attribute without an explicit
namespace is owned by the element -- namespaces are irrelevant.


> IMHO, one should not be recommending to use an attribute without
> namespace to carry a semantical meaning to be used by tools.

There is no such thing as an attribute with no namespace, merely global
attributes and attributes particular to specific elements.

 
> In this case, 'style' is a very common word (in several languages) very
> likely to be defined with other meanings by XML vocabularies.

Each vocabulary that wishes to use the "Syntax of CSS rules in HTML's
"style" attribute" [1] will have to specify what name they wish to give
that attribute.


> The clean way would be to define a namespace for this purpose.

Agreed.


> This namespace could be the XML 1.0 namespace if the XML Core WG aggreed
> that this practice is generic enough and 'style' would then become
> 'xml:style'.

I personally would think this would be a very bad idea. The style
attribute generally does not belong in content -- the whole _point_ of CSS
is to separate the content from the style (one of the many reasons XSL:FOs
are a bad idea IMHO).

 
> Otherwise, another option could be to create a XML Style specification
> and 'style' would then become 'xstyle:style'.

Or we could just introduce a namespace for CSS-related attributes and
elements. This idea has been mentioned before.

   <root xmlns:css="some css namespace">
      <foo css:style=" /* some inline style */ "/>
      <css:style title="preferred stylesheet"> /* an embedded stylesheet */ </css:style>
      <css:style title="alternate stylesheet"> /* another one */ </css:style>
   </root>

 
> In both cases, the major drawback would be that it would be incompatible
> with the current XHTML, SVG, MathML specs.

Just like the lang vs xml:lang thing, or the XLink vs <a> thing. [2]


> I think we are, here, facing exactly the same issue that the XML Linking
> WG is trying to solve through its "XLink Markup Name Control" [2] note.
>
> [1] http://www.w3.org/TR/2000/WD-css-style-attr-20001025
> [2] http://www.w3.org/TR/xlink-naming/

-- 
Ian Hickson                                     )\     _. - ._.)       fL
Netscape, Standards Compliance QA              /. `- '  (  `--'
+1 650 937 6593                                `- , ) -  > ) \
irc.mozilla.org:Hixie _________________________  (.' \) (.' -' __________

Received on Friday, 27 October 2000 06:36:37 UTC