W3C home > Mailing lists > Public > public-html@w3.org > February 2014

Re: XML:ID extension spec proposal to HTML5 documents

From: Leif Halvard Silli <xn--mlform-iua@xn--mlform-iua.no>
Date: Fri, 14 Feb 2014 07:40:54 +0100
To: David Carlisle <davidc@nag.co.uk>
Cc: public-html@w3.org
Message-ID: <20140214074054498395.220f9d21@xn--mlform-iua.no>
Myself to David, on Wed, 5 Feb 2014 07:36:48 +0100:
>>> The spec proposal already says that if both xml:id and id are
>>> assigned ID type, the XML tool will issue an (non-fatal) error
>>> message. But I will make bring the legacy aspect of the spec proposal
>>> much clearer in the next update.
>> If it is a validating  parser it is (or could be) a fatal error.
> The more fatal, the less of a ”danger” should xml:id be. 

David, regarding what you said about fatal error, then

1. A doc with HTML5 doctype doesn’t have a DTD.
2. A valid XML document must have a DTD.
3. Validating XML processors have to stamp docs
   with the HTML5 doctype as invalid.

Hence, since it is enough with a single fatal error, whether xml:id 
introduces additional errors (in addition the non-valid DOCTYPE) is 
thus irrelevant. What DTD-based specs, like MathML and SVG, did with 
xml:id, is thus in one way irrelevant.

Now, the XML:ID specification defines its own kinds of errors - xml:id 
errors, which should be shown to users,[1] without regard to whether 
the processor is validating or not.[2] 

Now, xmllint in non-validation mode reports a validity error if e.g. 
the DTD declares xml:id to be of CDATA type. But this is, again, a 
message from xmllint’s xml:id processor - not from xmllint’s xml 

Now, as for DOM 4, which governs the concept of ID that applies to 
HTML5,[3] then it does not operate with any error messages for the 
situation were an element has multiple IDs. All it says is that DOM 4 
does not allow more than a single ID attribute. DOM 4 speaks about use 
of DTDs in that regard (and claims that DTDs allowed multiple IDs per 
element - yes, XML DTDs made it technically possible, but it did not 
allow it and validating processors had to bark at it). DOM 4 fails to 
speak about xml:id and does not say what to do in case of multiple IDs 
or multiple, identical IDREFs on same element. 

XML 1.0 makes it up non-validatign processors themselves what to do - 
it is undefined whether to report uniqueness errors.[4] XMLlint report 
such errors, but they are not fatal.

Clearly, it would be safer w.r.t. avoiding errors if xml:id does not 
match the idref of a id attribute and also not use xml:id and id on 
same element - then we would avoid the uniqueness errors and the 
duplicate ID attributes specification errors.

[1] http://www.w3.org/TR/xml-id/#dt-xml-id-error

[2] http://www.w3.org/TR/xml-id/#dt-xml-id-proc

[3] http://www.w3.org/TR/2014/WD-dom-20140204/#concept-id

[4] http://www.w3.org/TR/REC-xml/#safe-behavior

leif halvard silli
Received on Friday, 14 February 2014 06:41:24 UTC

This archive was generated by hypermail 2.3.1 : Thursday, 29 October 2015 10:16:37 UTC