Using a combination of a W3C DTD such as XHTML1.1 and some extra XML parsing rules:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" [
<!ENTITY % Misc.extra "| tree" >
Results in a trailing ]> at the beginning of the page, although the pages validates correctly and allows <tree> tags as valid markup.
[Can't figure out how to add, so sorry for that in advance]
Actually, the issue applies to literally any inline DTD.
This, for example, is a rehashing of XHTML1.1 with an entity:
<!DOCTYPE html [
<!ENTITY % xhtml11.dtd
PUBLIC "-//W3C//XHTML 1.1//EN"
This is correct behavior, please see original bug for discussion. You are serving the document as HTML, so XML parsing rules do not apply to it.
*** This bug has been marked as a duplicate of bug 9280 ***
I am serving the document as XHTML, thus I should be able to include an XML-style DTD in either inline or referenced format.
Please provide an URL for the document for testing.
Unless Content-Type is one of XHTML ones as described in <http://www.w3.org/TR/xhtml-media-types/>, the document is parsed as HTML.
I'm trying to develop a "portable" application, so I cannot use server-side changing of HTTP headers - and I'm currently unaware of a way to do it in plain HTML.
I was of the impression that an XML declaration (and I'm using the xmlns <html> attribute, just in case) should suffice for a document to be interpreted as xhtml.
That is incorrect. Browsers look at Content-Type HTTP header field to determine whether a document is HTML or XML, never at content.
In that case, I'll just have to go with .xht(ml) since it seems it renders properly that way. Too bad it's registered by older operating systems.
One would think that XHTML is something to wish for in HTML, but alas, it seems not. I fail to see what backward compatibility problems allowing nested <> in the context of DTDs would cause, but I guess I'll just have to wait for a few years.
But really, XML declaration and DTD and a plain .html is not considered XHTML? Really?