This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 9964 - Namespaces section should be more explicit + touch the extensibility problem
Summary: Namespaces section should be more explicit + touch the extensibility problem
Status: RESOLVED FIXED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: pre-LC1 HTML/XHTML Compat. Authoring Guide (ed: Eliot Graff) (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: FPWD
Assignee: Eliot Graff
QA Contact: HTML WG Bugzilla archive list
URL: http://dev.w3.org/html5/html-xhtml-au...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-21 01:28 UTC by Leif Halvard Silli
Modified: 2010-10-05 13:07 UTC (History)
7 users (show)

See Also:


Attachments

Description Leif Halvard Silli 2010-06-21 01:28:28 UTC
I suggest replace the current text on namespaces with the following. (Justification below):

]]
5. Namespaces

5.1 Element level namespaces

HTML5 introduces undeclared (native) default namespaces for the root HTML element <html>, the root SVG element <svg> and the root MathML element <math>. For XML-compatibility, polyglot markup REQUIRES these default namespaces to be declared:

<html xmlns="http://www.w3.org/1999/xhtml">
 <svg xmlns="http://www.w3.org/2000/svg">
<math xmlns="http://www.w3.org/1998/Math/MathML">

Becuase HTML5 does not natively support it, the declaring of any other default or prefixed element namespace is not natively supported in polyglot markup.

5.2 Attribute level namespaces
HTML5 introduces undeclared (native) support for attributes in the XLink namespace and with the prefix <code>xlink:</code>. For XML-compatibility, polyglot markup REQUIRES that the XLink namespace is declared once on the HTML root element <html>, or once on the foreign element where is used — <svg> or <mathml>.

5.3 Attributes with the <code>xml:</code> or <code>xmlns:</code> prefix
HTML5 also allows the prefixed XML attributes base (xml:base), lang (xml:lang), space (xml:space) and xlink (xmlns:xlink). Declaring the namespace of xml prefix and the xmlns: prefix  is forbidden by XML.

5.4 Additional namespaces 
Other applicable specifications for XML and HTML may extend the possibility for declaring namespaces in polyglot markup – in particular at attribute level and attribute content level.  
[[

JUSTIFICATION: The suggested text solves the following problems

(1) The old text is unclear, at least to me as non-native English reader. For example to say that ]]The <html> element uses the namespace declaration "*"[[ is not perefectly clear since I am not used to hear that an element "*uses* the namespaces declaration". And, even HTML5 "uses namespaces" - exepct that they are not declared.

(2) I feel the text should be a bit more helpful and direct. The sectioning of this section helps doing that, I hope.

(3) Sam Ruby asked, when Facebook introduced their OpenGraph protocol: "does this affect the polyglot spec?" (Lots of the other comments seemd to take it for granted.) And does it? What about the RDFa in HTML, how does it affect the polyglot spec? My answer: The polyglot spec should in my view be very open to RDFa. On the other side, what is the extension point? Answer: Same as in HTML5 = applicable specifications.
Comment 1 Henri Sivonen 2010-06-21 08:37:12 UTC
(In reply to comment #0)

> HTML5 introduces undeclared (native) default namespaces for the root HTML
> element <html>, the root SVG element <svg> and the root MathML element <math>.

Actually, HTML5 defaults the namespace assignments for all HTML, SVG and MathML elements (not just the roots). It never generates namespace declarations implicitly in the DOM.

> For XML-compatibility, polyglot markup REQUIRES these default namespaces to be
> declared:
> 
> <html xmlns="http://www.w3.org/1999/xhtml">

Note that in text/html, this doesn't parse into a namespace declaration, so this needs to be an exception for strict tree identity.

>  <svg xmlns="http://www.w3.org/2000/svg">
> <math xmlns="http://www.w3.org/1998/Math/MathML">

Also, any HTML child of SVG <foreignObject> needs to have xmlns="http://www.w3.org/1999/xhtml".

> For XML-compatibility,
> polyglot markup REQUIRES that the XLink namespace is declared once on the HTML
> root element <html>, or once on the foreign element where is used — <svg> or
> <mathml>.

Please justify this assertion. See bug 9971.

> 5.3 Attributes with the <code>xml:</code> or <code>xmlns:</code> prefix
> HTML5 also allows the prefixed XML attributes base (xml:base), lang (xml:lang),
> space (xml:space) and xlink (xmlns:xlink). Declaring the namespace of xml
> prefix and the xmlns: prefix  is forbidden by XML.

HTML5 does not allowe xml:space, xml:base or xmlns:link on HTML elements in text/html.
Comment 2 Eliot Graff 2010-09-04 00:55:04 UTC
Edited section 5 to the following. I think I incorporated all of the comments here, except the proposed 5.4 below. There's always the understanding that other exceptions may be added at a later time.

5. Namespaces

The following rules apply to namespaces used in polyglot markup.
5.1 Element-Level Namespaces

[HTML5] introduces undeclared (native) default namespaces for the root HTML element <html>, the root SVG element <svg>, and the root MathML element <math>. The following default namespaces must be declared in polyglot markup, to maintain XML-compatibility [XML10]:

    * <html xmlns="http://www.w3.org/1999/xhtml">
    * <math xmlns=http://www.w3.org/1998/Math/MathML">
    * <svg xmlns="http://www.w3.org/2000/svg">

Polyglot markup must not declare any other default or prefixed element namespace, because [HTML5] does not natively support the declaring of any other default or prefixed element namespace.
5.2 Attribute-Level Namespaces

[HTML5] introduces undeclared (native) support for attributes in the XLink namespace and with the prefix xlink:. Polyglot markup must declare the XLink namespace on the HTML root element (<html>) or once on the foreign element where is used (<svg> or <mathml>), to maintain XML-compatibility [XML10].

In polyglot markup, the xlink prefix uses the namespace declaration xmlns:xlink="http://www.w3.org/1999/xlink" before using the xlink prefix for the following elements:

    * xlink:actuate
    * xlink:arcrole
    * xlink:href
    * xlink:role
    * xlink:show
    * xlink:title
    * xlink:type

Furthermore, polyglot markup defines the xlink prefix only on foreign elements (any SVG or MathML element) but not the root <html> element or any other HTML element.

Note that there are other prefixed attributes that can be used beyond xlink:href (such as xml:base). Polyglot markup does not declare these prefixes via xmlns. The prefixes are implicitly declared in XML and are automatically applied to the appropriate attributes in HTML.