hixie: teach the fragment serialisation algorithm about namespaces (whatwg r5743)

hixie: teach the fragment serialisation algorithm about namespaces
(whatwg r5743)

http://dev.w3.org/cvsweb/html5/spec/Overview.html?r1=1.4604&r2=1.4605&f=h
http://html5.org/tools/web-apps-tracker?from=5742&to=5743

===================================================================
RCS file: /sources/public/html5/spec/Overview.html,v
retrieving revision 1.4604
retrieving revision 1.4605
diff -u -d -r1.4604 -r1.4605
--- Overview.html 6 Jan 2011 22:26:56 -0000 1.4604
+++ Overview.html 6 Jan 2011 22:58:41 -0000 1.4605
@@ -61728,20 +61728,73 @@
 
        <dd>
 
-        <p>Append a U+003C LESS-THAN SIGN character (&lt;),
-        followed by the element's tag name. (For nodes created by the
-        <a href="#html-parser">HTML parser</a> or <code title="">Document.createElement()</code>, the tag name will be
-        lowercase.)</p>
+        <p>If <var title="">current node</var> is an element in the
+        <a href="#html-namespace-0">HTML namespace</a>, the <a href="#mathml-namespace">MathML
+        namespace</a>, or the <a href="#svg-namespace">SVG namespace</a>, then let
+        <var title="">tagname</var> be <var title="">current
+        node</var>'s local name. Otherwise, let <var title="">tagname</var> be <var title="">current node</var>'s
+        qualified name.</p>
+
+        <p>Append a U+003C LESS-THAN SIGN character (&lt;), followed
+        by <var title="">tagname</var>.</p>
+
+        <p class="note">For <a href="#html-elements">HTML elements</a> created by the
+        <a href="#html-parser">HTML parser</a> or <code title="">Document.createElement()</code>, <var title="">tagname</var> will be lowercase.</p>
 
         <p>For each attribute that the element has, append a U+0020
-        SPACE character, the attribute's name (which, for attributes
-        set by the <a href="#html-parser">HTML parser</a> or by <code title="">Element.setAttributeNode()</code> or <code title="">Element.setAttribute()</code>, will be lowercase), a
+        SPACE character, the <a href="#attribute-s-serialized-name" title="attribute's serialized
+        name">attribute's serialized name as described below</a>, a
         U+003D EQUALS SIGN character (=), a U+0022 QUOTATION MARK
         character ("), the attribute's value, <a href="#escapingString" title="escaping a string">escaped as described below</a> in
         <i>attribute mode</i>, and a second U+0022 QUOTATION MARK
         character (").</p>
 
-        <p>While the exact order of attributes is UA-defined, and may
+        <p>An <dfn id="attribute-s-serialized-name">attribute's serialized name</dfn> for the purposes
+        of the previous paragraph must be determined as follows:</p>
+
+        <dl class="switch"><dt>If the attribute has no namespace</dt>
+
+         <dd>
+
+          <p>The attribute's serialized name is the attribute's local
+          name.</p>
+
+          <p class="note">For attributes on <a href="#html-elements">HTML elements</a>
+          set by the <a href="#html-parser">HTML parser</a> or by <code title="">Element.setAttributeNode()</code> or <code title="">Element.setAttribute()</code>, the local name will
+          be lowercase.</p>
+
+         </dd>
+
+
+         <dt>If the attribute is in the <a href="#xml-namespace">XML namespace</a></dt>
+
+         <dd><p>The attribute's serialized name is the string "<code title="">xml:</code>" followed by the attribute's local
+         name.</dd>
+
+
+         <dt>If the attribute is in the <a href="#xmlns-namespace">XMLNS namespace</a> and the attribute's local name is <code title="">xmlns</code></dt>
+
+         <dd><p>The attribute's serialized name is the string "<code title="">xmlns</code>".</dd>
+
+
+         <dt>If the attribute is in the <a href="#xmlns-namespace">XMLNS namespace</a> and the attribute's local name is not <code title="">xmlns</code></dt>
+
+         <dd><p>The attribute's serialized name is the string "<code title="">xmlns:</code>" followed by the attribute's local
+         name.</dd>
+
+
+         <dt>If the attribute is in the <a href="#xlink-namespace">XLink namespace</a></dt>
+
+         <dd><p>The attribute's serialized name is the string "<code title="">xlink:</code>" followed by the attribute's local
+         name.</dd>
+
+
+         <dt>If the attribute is in some other namespace</dt>
+
+         <dd><p>The attribute's serialized name is the attribute's
+         qualified name.</dd>
+
+        </dl><p>While the exact order of attributes is UA-defined, and may
         depend on factors such as the order that the attributes were
         given in the original markup, the sort order must be stable,
         such that consecutive invocations of this algorithm serialize an
@@ -61770,9 +61823,8 @@
         serialization algorithm</a> on the <var title="">current
         node</var> element (thus recursing into this algorithm for
         that element), followed by a U+003C LESS-THAN SIGN character
-        (&lt;), a U+002F SOLIDUS character (/), the element's tag name
-        again, and finally a U+003E GREATER-THAN SIGN character
-        (&gt;).</p>
+        (&lt;), a U+002F SOLIDUS character (/), <var title="">tagname</var> again, and finally a U+003E
+        GREATER-THAN SIGN character (&gt;).</p>
 
        </dd>

Received on Wednesday, 12 January 2011 02:44:12 UTC