RE: HTML <link rel="stylesheet"> underspecified with multiple lan guages

Is the media attribute applicable in the examples Ian provided? For
example:

media="screen" 

    <?xml-stylesheet href="a.css" ?>
    <?xml-stylesheet href="b.xslt" media="screen" ?>
    <foo/>

IMHO, the ability of using this is rather mandatory. Besides, some kind
of query (meaning something like the 'media') should take place for the
agent to 'choose' a stylesheet.

It's logical to ignore the CSS if the XSLT is preferred in the situation
(as a web browser) or apply the CSS stylesheet if the media is different
than 'screen'. This would actually be good for me as a developer, since
I could specify style for every possible media in that CSS. 

Besides, the XSLT could have the 'result tree' link to the CSS after the
transformation (if the CSS has style relative to 'screen').

Now, if an attribute like 'media' is not applicable, it should be better
to give default priority to the XSLT stylesheet (ignore the CSS when the
agent supports XSL) and let agents that do not support XSLT use the CSS
instead (something like alternative style).

Wow. I managed to loose myself. Too much caffeine I guess.

Kindest regards,

Manos


> -----Original Message-----
> From: Jeffrey Yasskin [mailto:jyasskin@appcomp.com]
> Sent: Monday, June 25, 2001 9:33 PM
> To: 'www-style@w3.org'
> Subject: RE: HTML <link rel="stylesheet"> underspecified with 
> multiple lan guages
> 
> 
> Good points!
> Another reason this is important is that Mozilla and IE 
> support different
> MIME types for XSLT stylesheets. IE (MSXML3) requires the non-standard
> "text/xsl" while I believe Mozilla requires "text/xml". There 
> ought to be
> some way to get both browsers to transform a document 
> client-side, without
> using server-side scripting.
> Maybe the spec should state that UAs should ignore any 
> stylesheets whose
> language they do not understand.
> 
> Apparently there is a way to set the default stylesheet language.
> (http://www.w3.org/TR/html4/present/styles.html#h-14.2.1) 
> I've never seen it
> used, but it may be applicable to this discussion.
> 
> Jeffrey Yasskin
> 
> -----Original Message-----
> From: Ian Hickson [mailto:ian@hixie.ch]
> Sent: Monday, June 25, 2001 12:28 PM
> To: www-html@w3.org
> Cc: www-talk@w3.org; www-style@w3.org
> Subject: HTML <link rel="stylesheet"> underspecified with multiple
> languages
> 
> 
> 
> (Pardon the cross-posting, but this directly affects both 
> HTML and the W3C
> stylesheet languages as well as being an architectural issue. 
> I strongly
> suggest and request that discussion continue only in 
> www-style@w3.org.)
> 
> 
> HTML4's <link> element (when used to specify stylesheets), 
> and thus the
> <?xml-stylesheet> PI, is underspecified in two particular 
> critical cases
> and one useful case: first, multiple stylesheets when one is 
> in a language
> that does not cope with multiple stylesheets, second, 
> multiple stylesheets
> in different languages [1], and third, transforming stylesheets and
> alternate stylesheets. In addition there are problems with the DOM.
> 
> 
> Regarding the first point, the behaviour of UAs when hitting following
> simple XML document is undefined:
> 
>    <?xml-stylesheet href="a" ?>
>    <?xml-stylesheet href="b" ?>
>    <foo/>
> 
> ...if "a" is returned with the MIME type "text/xsl" 
> (regardless of what
> the MIME type of "b" is). Should the document be processed by 
> stylesheet
> "a"? Stylesheet "a" then stylesheet "b"? Should "b" be offered as an
> alternative at any point? Should "b" be considered a second 
> class citizen
> and ignored? Consider the same questions but with "a" sent as 
> "text/css"
> and "b" sent as "text/xsl".
> 
> 
> Regarding the second point, imagine if "a" is sent as 
> "text/css" and "b"
> is sent as "text/jsss" (a fictional MIME type for the JavaScript Style
> Sheet nightmare that NS4 "supports"). Both of these support 
> the concept of
> a cascade, but their cascade mechanisms are incompatible. 
> Which stylesheet
> should be applied?
> 
> 
> Third, consider the following:
> 
>    <?xml-stylesheet href="a" title="preferred" ?>
>    <?xml-stylesheet href="b" title="alternate" ?>
>    <bar/>
> 
> Imagine if "a" is sent as "text/css" and "b" is sent as 
> "text/xsl". The
> initial situation is well defined, the UA should provide a UI to the
> alternate stylesheets (like Netscape 6.1 PR1 does [2]). 
> However, if the
> second stylesheet is selected, what should happen? Should the 
> alternate
> stylesheet UI disappear?
> 
> 
> Finally, imagine that in the context of the following document:
> 
>    <baz/>
> 
> ...the following script is executed:
> 
>    document.insertBefore(
>       document.createProcessingInstruction('xml-stylesheet', 
> 'href="a"'),
>       document.documentElement);
> 
> ...if "a" is sent back as "text/xsl". What happens to the DOM? What
> happens to the document as far as the user is concerned?
> 
> 
> These issues are all important architectural issues that should be
> resolved as soon as possible, so that browser development 
> continues in a
> well defined manner and we don't end up in a situation where 
> every browser
> handles these examples differently.
> 
> 
> -- Footnotes --
> [1] http://www.w3.org/TR/html4/present/styles.html#h-14.4 says:
> # Note. This specification does not specify how style sheets from
> # different style languages cascade. Authors should avoid mixing style
> # sheet languages.
> 
> [2] See, for example, the "View | Use Stylesheet" menu in that browser
> while looking at http://damowmow.com/mozilla/demos/layout/ .
> 
> -- 
> Ian Hickson                                            )\     
> _. - ._.)   fL
> Invited Expert, CSS Working Group                     /. `- '  (  `--'
> The views expressed in this message are strictly      `- , ) -  > ) \
> personal and not those of Netscape or Mozilla. ________ (.' 
> \) (.' -' ______
> 
> 

Received on Tuesday, 26 June 2001 02:51:16 UTC