Bug 94149 - DTD extension - trailing ]>
Summary: DTD extension - trailing ]>
Status: RESOLVED DUPLICATE of bug 9280
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows 7
: P2 Normal
Assignee: Nobody
Depends on:
Reported: 2012-08-15 14:28 PDT by fhp.mail
Modified: 2012-08-17 14:33 PDT (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description fhp.mail 2012-08-15 14:28:31 PDT
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.
Comment 1 fhp.mail 2012-08-15 14:44:28 PDT
[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"
            "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" >
Comment 2 Alexey Proskuryakov 2012-08-15 19:20:15 PDT
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 ***
Comment 3 fhp.mail 2012-08-17 09:12:49 PDT
I am serving the document as XHTML, thus I should be able to include an XML-style DTD in either inline or referenced format.
Comment 4 Alexey Proskuryakov 2012-08-17 09:26:59 PDT
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.
Comment 5 fhp.mail 2012-08-17 10:04:07 PDT
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.
Comment 6 Alexey Proskuryakov 2012-08-17 10:38:59 PDT
That is incorrect. Browsers look at Content-Type HTTP header field to determine whether a document is HTML or XML, never at content.
Comment 7 fhp.mail 2012-08-17 14:33:01 PDT
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?