[whatwg] Re: DOCTYPE shouldn't be optional
ian at hixie.ch
Wed Jul 7 06:00:29 PDT 2004
On Mon, 5 Jul 2004, Malcolm Rowe wrote:
> Hmm, yes. I was wondering about this as well. As far as I know, all
> post-HTML2 HTML documents and all XHTML documents require a DOCTYPE.
That hinges on the definition of "XHTML document".
XHTML defines the semantics of elements in a namespace.
With just "XML" and "Namespaces in XML", you can then refer to this
If you then create a document using "XML" and "Namespaces in XML" that
only contains elements from that namespace, the semantics are
well-defined, since the XHTML spec defines the semantics.
But is it an XHTML document? You didn't start from the XHTML spec to make
the document, you started from "XML" and "Namespaces in XML", and then
just used the XHTML namespace.
The only difference between a document that complies to XHTML 1.0, and the
document you create by using XML, "Namespaces in XML", and the XHTML
namespace, is the presence or absence of the DOCTYPE.
> The spec currently reads: "Documents that use the new features described
> in this specification using XHTML or other XML languages over HTTP must
> be served using an XML MIME type such as application/xml or
> application/xhtml+xml and must not be served as text/html. [RFC3023]
> Documents served in this way may contain a DOCTYPE if desired, but this
> is not required."
> There doesn't seem to be any rationale about why this change was made,
> and the way it's worded almost suggests to me that it might be a remnant
> of an older paragraph.
The point is that it isn't a change. It's a fact. It described the current
reality of using namespaces in XML.
The real question is, why does XHTML1 claim otherwise?
> "Documents served in this way" doesn't seem to make a lot of sense, given
> the preceding sentence is talking about the valid MIME types that can be
> used to serve XHTML; if it means the documents in the previous sentence, it
> should just be "These documents", and if it means documents served as
> text/html, it should say so (though that makes even less sense).
Fair point. "These documents" it is.
> I'm also confused about "other XML languages over HTTP" - this
> specification extends HTML and XHTML, so what other (non-XHTML) XML
> languages can this spec apply to?
Any. That's the beauty of XML namespaces. You could write an SVG document
that included some XHTML elements inside a <foreignObject> block, for
Ian Hickson U+1047E )\._.,--....,'``. fL
http://ln.hixie.ch/ U+263A /, _.. \ _\ ;`._ ,.
Things that are impossible just take longer. `._.-(,_..'--(,_..'`-.;.'
More information about the whatwg