W3C home > Mailing lists > Public > www-html@w3.org > June 2007

Validation of script tag

From: Lars Kappert <larskappert@gmail.com>
Date: Mon, 18 Jun 2007 10:30:07 +0200
To: <www-html@w3.org>
Message-ID: <000901c7b182$e2054710$b932a8c0@LARS>

The XHTML 1.0 DTD states the following:

<!-- script statements, which may include CDATA sections -->
<!ELEMENT script (#PCDATA)>
<!ATTLIST script
  id          ID             #IMPLIED
  charset     %Charset;      #IMPLIED
  type        %ContentType;  #REQUIRED
  src         %URI;          #IMPLIED
  defer       (defer)        #IMPLIED
  xml:space   (preserve)     #FIXED 'preserve'

The XHTML 1.1 DTD (Scripting Module) states the following:

<!ENTITY % script.attlist  "INCLUDE" >
<!ATTLIST %script.qname;
      charset      %Charset.datatype;       #IMPLIED
      type         %ContentType.datatype;   #REQUIRED
      src          %URI.datatype;           #IMPLIED
      defer        ( defer )                #IMPLIED
<!-- end of script.attlist -->]]>

Here's my markup (attached as well):

  <script type="text/javascript" xml="http://www.w3.org/1999/xhtml"
xml:m="http://www.lars.com/mynamespace" id="holder">
    // script...

Why does it not validate in XHTML 1.0 and 1.1? I understand there are only
few circumstances this is needed, but I'm wondering why it is not allowed to
define namespaces in the script-tag? Next to that, the id-attribute is not
allowed anymore in XHTML 1.1, why is that?

Some explanation would be really appreciated, thanks in advance.

Received on Monday, 18 June 2007 12:05:16 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:06:16 UTC