Bugzilla – Bug 20251
[SER30] DOCTYPE declaration - prefix in name
Last modified: 2013-01-15 15:35:58 UTC
Section 6.1.7 para 1 states:
The name following <!DOCTYPE MUST be the same as the local part of the name of the element.
However, XML 1.0 requires:
Validity constraint: Root Element Type
The Name in the document type declaration must match the element type of the root element.
and I believe "element type" here means the lexical QName as written, including any prefix, since XML 1.0 is not namespace-aware.
That was intentional. Item 4 in the second bulleted list in section 6 of serialization states, in part, "If the value of the html-version serialization parameter is 5.0, any element node that has a prefix and is in the XHTML namespace, MathML namespace, or SVG namespace MUST be serialized with an unprefixed element name."
That's the "prefix stripping" that the Working Groups requested. The DOCTYPE for the XHTML output method must strip the prefix from the element name as well. So if the data model instance was
and doctype-public and doctype-system are both absent, the serialized result will be
But now that you've drawn my attention to it, I see that if either doctype-system or doctype-public is not absent, the behaviour is defined by the XML output method, which will preserve the prefix, resulting in something like the following for the same example:
<!DOCTYPE xhtml:html "about:legacy-compat"><html><body></body></html>
which is clearly incorrect.
Thanks - I missed that.
Michael, at their joint teleconference of 18 December 2012, the XSLT and XQuery Working Groups decided to revise the Serialization 3.0 document to address the issue identified in comment #1. The revised text will appear in the next working draft of Serialization 3.0.
As you were present when this decision was made, I trust you agree with it, and I will mark the bug as CLOSED.
The changes for this bug have been subsumed by the changes for bug 20261.