XHTML document is rendered as pretty-print if xmlns attribute is missing or invalid

RESOLVED INVALID

Status

SeaMonkey
General
RESOLVED INVALID
13 years ago
13 years ago

People

(Reporter: Alexey Chernyak, Unassigned)

Tracking

Trunk
x86
Windows Server 2003

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

216 bytes, application/xhtml+xml
Details
(Reporter)

Description

13 years ago
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8a5) Gecko/20041023
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.7.3) Gecko/20041014
Firefox/0.10

An XHTML 1.0 or 1.1 document is rendered as XML pretty-print when <html> tag is
missing xmlns= attribute.

In XHTML DTDs this attribute has default value specified. Which means it's value
is known when the attribute is omitted in the document.

Also the attribute is of type #FIXED, which means that if a different value is
provided, XML parser should raise an error, which Mozilla doesn't do. But since
we're not a validating browser, this is irrelevant, though I think pretty-print
is not the best reaction to this either.

Here are the relevant DTD definitions:

XHTML 1.0:

<!ELEMENT html (head, body)>
<!ATTLIST html
  %i18n;
  id          ID             #IMPLIED
  xmlns       %URI;          #FIXED 'http://www.w3.org/1999/xhtml'
  >

XHTML 1.1:

<!ENTITY % XHTML.xmlns  "http://www.w3.org/1999/xhtml" >
<!ENTITY % XHTML.xmlns.attrib
     "xmlns        %URI.datatype;           #FIXED '%XHTML.xmlns;'
      %XLINK.xmlns.attrib;"
>
<!-- html: XHTML Document Element ...................... -->

<!ENTITY % html.element  "INCLUDE" >
<![%html.element;[
<!ENTITY % html.content  "( %head.qname;, %body.qname; )" >
<!ENTITY % html.qname  "html" >
<!ELEMENT %html.qname;  %html.content; >
<!-- end of html.element -->]]>

<!ENTITY % html.attlist  "INCLUDE" >
<![%html.attlist;[
<!ENTITY % XHTML.version.attrib
     "version      %FPI.datatype;           #FIXED '%XHTML.version;'"
>
<!ATTLIST %html.qname;
      %XHTML.xmlns.attrib;
      %XHTML.version.attrib;
      %I18n.attrib;
>
<!-- end of html.attlist -->]]>



To reproduce, see attached testcase.

Expected behaviour: Render XHTML documents with missing xmlns= attribute.
Current behaviour: Document is pretty-printed.
(Reporter)

Comment 1

13 years ago
Created attachment 163183 [details]
testcase

A valid XHTML 1.1 document with a missing xmlns= attribute on <html> tag.
INVALID. You can't have a valid XHTML document if it doesn't have an xmlns
attribute, since without an xmlns attribute, the element isn't in the XHTML
namespace. See XHTML 1.0 section 3.1.1 subitem 3, and Namespaces in XML 1.0,
section 4, subsection "Namespace Constraint: Prefix Declared", paragraph 2,
sentence 4.
Status: NEW → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → INVALID
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.