ISSUE: 'script' element and 'type' attribute

Hi all,

   Over in svg-developers the following question has come up:

     Is the 'type' attribute on the 'script' element required or not?

    The wording in section 18.1.2 is tantalizingly ambiguous:

	It is also possible to specify the scripting language for each
	individual 'script' element by specifying a
	type attribute on the 'script' element.

    Reading further in section 18, in particular the DTD for the script
element:

<!ATTLIST %SVG.script.qname; [...]
      type %ContentType.datatype; #REQUIRED >

I would come to the conclusion that it is required (after all
the DTD says it is).  Also in the description of the attribute there
is no discussion of the behavior when the attribute is not provided
(as is customary when attributes can be omitted).

   But then Johnathan Watt pointed out this mail from Robin Berjon:

	http://groups.yahoo.com/group/svg-developers/message/46338

    Philippe Lhoste wrote:
    > Note that the type attribute is mandatory: the SVG Validation
    > service <http://jiggles.w3.org/svgvalidator/> will complain if
    > you omit it.

    Robin Berjon wrote:
    That is due to an error in the DTD which the validator propagates.
    If 'type' were required 'contentScriptType' would be useless.
    Jonathan is right: it is best to not specify the type ever, unless
    of course you're not using ECMAScript.

---

   Because Robin is a SVG-WG member I was nervous to call any statement
of his into question, but then I remembered a rumor that even WG
members were, at some point, human and had been (on very rare
occasions) known to misspeak (or more correctly have statements
misinterpreted by the unwashed masses).

   So I took a second look at his statement, and I couldn't help but
notice that the description of 'contentScriptType' appears to go out
of it's way to  indicate that it applies to event strings, yet fails
to mention the script element at all:

	This attribute sets the scripting language used to process the
	value strings in event attributes.

   So it does have a very real purpose even if 'type' were required
(and in fact it seems to be clear about what it's purpose is). So
if he was wrong about one thing perhaps he's wrong about the other as
well.

   I don't have a strong opinion on this and given the political
standoff over what the mime type for EcmaScript is we might be
best off with a "Script-Language-That-Must-Not-Be-Named" solution
(make 'type' optional), but at the very least an errata and an
updated DTD must be issued.  This is a fairly serious conformance
issue (just about any document with script elements has to deal
with this somehow).

Received on Tuesday, 25 January 2005 22:07:36 UTC