Re: XML Events 2 Scripting Module in XHTML 2

Greetings Mark, I think that you are correct in pointing out that the 
<script> in the latest editors draft suffers from the problem is that its 
behaviour is not backwards-compatible with current browsers.

I think that we should have two elements defined in the handlers module. A 
new element, perhaps <handler> along the lines we have been discussing. We 
should also keep a <script> that is backwards-compatible with current 
browsers but with the additional of @implements.

If we proceed with <handler> and <script> then we should also allow an 
additional attribute to supplement @handler that allows a script function 
to be used much as it is today.

        @handler specifies the URI of resource that defines the action to 
take if the event reaches the observer.
        @function specifies the name of a function that is to be invoked 
if the event reaches the observer.

I think you are also correct in suggesting that 
        <script type="text/javascript" src="../mystuff/m.js" />
would be shorthand for
        <handler event="load" type="text/javascript" src="../mystuff/m.js" 

Regards, Roland

"Mark Birbeck" <>
"Shane McCarron" <>
21/07/2008 10:53
Re: XML Events 2 Scripting Module in XHTML 2

Hi Shane,

I keep forgetting to mention that I also think we should change the
name of <script> in the module.

The problem is that its behaviour is not backwards-compatible with
current browsers. Current behaviour is to execute the script as it is
encountered, which will mean that handlers for specific events would
be run regardless:

  <xf:action ev:event="xforms-invalid">
    <script type="text/javascript">
      <!-- this will be run on load in old browsers -->

  <script ev:event="xforms-invalid" type="text/javascript">
    <!-- so will this -->

The sub-text is of course that it is good to make as much of what we
do backwards-compatible, so that our modules can be used independently
of XHTML 2.

Of course, we don't necessarily want to 'orphan' <script> and say that
it's no longer used. One way to avoid this would be to define <script>
as being a shorthand for:

  <script-handler-element-name-we-invent ev:event="load" 
    <!-- do this on load -->

<script-handler-element-name-we-invent> may just be <handler>...I
can't remember what happened to the XML Handler draft.

And the 'load' event might actually be something more akin to 'element
ready', since browsers seem to load and process scripts before the
entire document has completed loading.

But I'm sure you get what I'm driving at....



On Mon, Jul 21, 2008 at 2:48 AM, Shane McCarron <> wrote:
> While editing XHTML 2 tonight, attempting to make all of the external
> references hang together, I noticed something that I don't know the 
> for:
> If we are integrating XML Scripting into the XHTML namespace (as we have
> planned to do) then the script element will bring with it the attributes
> "encoding", "implements", "src", and "type".  Naturally, we also want 
> "script" element to take the Common attributes, which perforce include 
> Metainformation attributes (RDFa), the embedding attributes from XHTML 
> etc...  Now @src and @encoding from the Embedding module are probably
> consistent with what we meant for the script element.   So that's fine. 
> think.  Correct me if I am wrong.
> @implements is a new thing, and there is no conflict.
> @type...   XML Events 2 goes to great pains to explain what @type 
> and I think it is exactly what is meant by @srctype in XHTML 2.  So... I 
> not sure what to do here.  We can change @type to @srctype in XML Events 
>  We can bring in @type on the script element, also bring in @src, and 
> have the script element reference the Common attributes collection (use 
> subset that makes sense, but does not include the embedding 
> or maybe something else.
> Help?
> --
> Shane P. McCarron                          Phone: +1 763 786-8160 x120
> Managing Director                            Fax: +1 763 786-8180
> ApTest Minnesota                            Inet:

Mark Birbeck, webBackplane

webBackplane is a trading name of Backplane Ltd. (company number
05972288, registered office: 2nd Floor, 69/85 Tabernacle Street,
London, EC2A 4RR)

Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU

Received on Wednesday, 6 August 2008 13:03:00 UTC