Re: [DOMCore] DocumentType: optional publicId and systemId

On 6/3/11 1:26 AM, Ms2ger wrote:
> On 06/02/2011 11:12 PM, David Flanagan wrote:
>> §5.7 includes this text:
>>
>>> When a |DocumentType
>>> <http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#documenttype>| 
>>>
>>> node is created, its name
>>> <http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-doctype-name> 
>>>
>>> is always given. Unless explicitly given when a |DocumentType
>>> <http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#documenttype>| 
>>>
>>> node is created, its public ID
>>> <http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-doctype-publicid> 
>>>
>>> and system ID
>>> <http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-doctype-systemid> 
>>>
>>> are the empty string.
>>>
>>
>> But the IDL for DOMImplementation.createDocumentType() is:
>>
>>> DocumentType
>>> <http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#documenttype> 
>>> createDocumentType
>>> <http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#dom-domimplementation-createdocumenttype>([TreatNullAs=EmptyString] 
>>>
>>> DOMString qualifiedName, DOMString publicId, DOMString systemId);
>>
>> Shouldn't the publicId and systemId arguments be annotated
>> [TreatUndefinedAs=EmptyString]? And maybe also
>> [TreatNullAs=EmptyString]? Or maybe they should just be declared
>> optional and the textual description of createDocumentType should be
>> updated to specify the empty string defaults.
>
> Not necessarily. The defaults you quoted don't apply here, as the 
> algorithm that defines createDocumentType gives the public and system 
> ID explicitly when creating the object.
>
> I haven't changed the spec.
>
> Ms2ger
Okay, I see.  Its confusing, though.  As a JS programmer, the "unless 
explicitly given" in §5.7 made me think that I could omit the arguments 
and the undefined values would be converted to empty strings. I think 
the only place that sentence in §5.7 applies is in the algorithm for 
createHTMLDocument().  So why not cut the text in §5.7 and change 
createHTMLDocument() to explicitly specify empty strings?

     David

Received on Friday, 3 June 2011 17:24:36 UTC