Validation of script tag

Hello,

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" >
<![%script.attlist;[
<!ATTLIST %script.qname;
      %XHTML.xmlns.attrib;
	  %id.attrib;
      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):

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

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