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 24210 - Please handle the case of XML attributes with namespaces but no prefix
Summary: Please handle the case of XML attributes with namespaces but no prefix
Status: RESOLVED DUPLICATE of bug 24208
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: DOM Parsing and Serialization (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Travis Leithead [MSFT]
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-06 04:29 UTC by Michael[tm] Smith
Modified: 2014-10-13 23:46 UTC (History)
5 users (show)

See Also:


Attachments

Description Michael[tm] Smith 2014-01-06 04:29:03 UTC
Quoting Victor's description from Bug #24208:

The DOM Core API setAttributeNS allows the creation of attributes that have a non-null namespace URI, but no prefix.

A minimal example follows below.
var doc = (new DOMParser()).parseFromString("<test/>", "text/xml", null);
doc.documentElement.setAttributeNS("http://www.example.com/", "attr", "value");

The XML serialization algorithm specified below does not seem to handle this case.
https://dvcs.w3.org/hg/innerhtml/raw-file/tip/index.html#dfn-concept-serialize-xml

(searching for "XML serialization of the attributes" shows the relevant paragraph)

Firefox and Internet Explorer handle this case by generating prefixes for the attributes.

Blink and WebKit do not yet handle this case, but I'm working on it. http://crbug.com/248044
Comment 1 Travis Leithead [MSFT] 2014-10-13 23:46:29 UTC
:-)

*** This bug has been marked as a duplicate of bug 24208 ***