Re: Behavioral Extensions to CSS

* Jeffrey Yasskin wrote:
>And how do you attach these events to the XML elements?

That's a problem for the relevant markup language. If you really want a
generic method (and I can't see any good reason why there should be
such) introduce something similar to <?xml-stylesheet ... ?> for scripts
and not abuse CSS for this purpose.

>Where in an XML document can you place the Javascript code to attach 
>the events?

That depends, XHTML and SVG have the script element and on<event>
handlers XHTML has aswell a link element to include external scripts,
etc.

>>Does it? User agent without CSS support won't be able to make use of
>>that and scripting fails completly.
>
>The same could have been said about basic CSS when it was released. No 
>browsers had CSS support, and using pure CSS meant your pages looked 
>horrible in plain HTML browsers.

If they were horribly marked up, possibly, but pages didn't break
without CSS support.

>Should CSS not have been developed for this reason?

You want to require support for _two_ supplemental technologies to make
use of _one_ supplemental technologie, that's nonsense.

>>   /* some script */
>>   ...addEventListener("submit", submitListener, 0);
>>   ...submitListener::handle_event( evt )
>>   {
>>     /* do something */
>>   }
>
>In what do you enclose that script block in XML?

As I said, that depends on the document language.

>In HTML, will that addEventListener be in the onload event?

Please read the DOM Level 2 Events recommendation.

>In any good page, JavaScript is an extra, since users can and do turn of 
>JavaScript.

As they may turn of style sheets. Where is your point? Did you ever
heard people complaining that CSS doesn't work in NN4 you deactivate
JavaScript?

>JavaScript is more concerned with the appearance and behavior of 
>a page than it is with the content.

As is CSS.
-- 
Björn Höhrmann { mailto:bjoern@hoehrmann.de } http://www.bjoernsworld.de
am Badedeich 7 } Telefon: +49(0)4667/981028 { http://bjoern.hoehrmann.de
25899 Dagebüll { PGP Pub. KeyID: 0xA4357E78 } http://www.learn.to/quote/

Received on Thursday, 2 August 2001 16:10:36 UTC