[SVG12t] About Script element...

Hi,
I would like to clarify - if possible - some doubts about the SVG1.2 Tiny WD


1)

Pag. 175 Section 15.2 "Any scripting logic associated with a given*
script * element
is executed at most once."

In my understanding the Script element can contain script text of two kind:
functions or global script.

<script type="application/ecmascript"><![CDATA[

//GLOBAL SCRIPT
var x = 0;
var y = 50;

//FUNCTION
function first()
{
textElement = document.getElementById("svgtext");
svgRoot = document.getElementById("root");
}
[...]

Global script text should be fired at most once when the scene is loaded but
script functions can be invoked by an handler element and therefore can be
executed several times depending on the handler logic (responding to a
ev:click event for example). Is this correct or I missed any important
information?

Is it possible to have several script elements in the same SVG Document? If
yes, how the uDOM engine should deal with them? From an implementation point
of view it should put together all the script text and then execute it as a
whole script?

2)

Pag. 163

[…]
<!-- handler which is called when myRect2 is replaced by myRectNew -->
<handler xml:id="myNavigationHandler"
type="application/ecmascript"><![CDATA[
var myRect1 = document.getElementById("myRect1");
var myRect3 = document.getElementById("myRect3");
[...]

Here the handler script text is contained in a CDATA section. This is the
only example in the spec where handler has a CDATA  child , in the other
examples (Pag. 202, 203 …) the CDATA node does not exist. It is CDATA needed
for the handler element or is a typo?

Thank you in advance and Best Regards,


Diego

Received on Tuesday, 2 May 2006 13:49:43 UTC