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 25062 - Add specialized serialization requirements for element namespaces in XML/XMLNS
Summary: Add specialized serialization requirements for element namespaces in XML/XMLNS
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: DOM Parsing and Serialization (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Travis Leithead [MSFT]
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-15 00:12 UTC by Travis Leithead [MSFT]
Modified: 2014-03-28 21:17 UTC (History)
2 users (show)

See Also:


Attachments

Description Travis Leithead [MSFT] 2014-03-15 00:12:46 UTC
Some notes, while I was working on bug 24208:

Firefox-as-reference:
"<xml:div/>" == new XMLSerializer().serializeToString(document.createElementNS("http://www.w3.org/XML/1998/namespace", "foot:div"));

* "xml" prefix trumps actual prefix for nodes in the XML namespace in the XML Serializer.
(Same goes for nested elements with XML namespace:
...appendChild(document.createElementNS("http://www.w3.org/XML/1998/namespace", "toe:span"));
"<xml:div><xml:span/></xml:div>" -- XMLSerializer
"<foot:div><toe:span></toe:span></foot:div>" -- HTML Serializer uses QName

Per DOM4:
* XMLNS is tightly controlled (reserved) via createElementNS -- prefix/QName <-must match-> namespace
* XML prefix -> XML namespace is controlled (reserved), but not vice-versa. 

Possible cases to handle:
"<xmlns:div/>" == new XMLSerializer().serializeToString(document.createElementNS("http://www.w3.org/2000/xmlns/", "xmlns:div"));
"<xmlns xmlns="http://www.w3.org/2000/xmlns/"/>" == new XMLSerializer().serializeToString(document.createElementNS("http://www.w3.org/2000/xmlns/", "xmlns"));
* ASSERT: Follows generic serializer rules with regard to expansion/prefix use.
Comment 1 Travis Leithead [MSFT] 2014-03-23 00:05:01 UTC
Took care of this in most recent changes.
Comment 2 Travis Leithead [MSFT] 2014-03-28 21:17:36 UTC
Note, this was changeset:
https://dvcs.w3.org/hg/innerhtml/rev/393c42a44e7f