Re: DOM Level 3 Validation update

Curt Arnold wrote:

> Benjamin C. Chang wrote:
> ...
>
>>> validateDocument:
>>>
>>> How would warnings be issued?  There appears to be an interface name
>>> missing between "[DOM Level 3 Core]" and "interface"
>>>   
>>
>>
>> The method makes use of the passed-in error handler, as described
>> in the DOM L3 CORE DOMConfiguration interface; warnings are
>> handled through this exception handler.  There is a link to this
>> interface now.
>>  
>>
>
> A return value from the validation would be useful when the only 
> interest was if the document was schema or DTD valid.  Without an 
> explicit return value, it might be inferred that validation could be 
> asynchronous. 


"Passed-in error handler" suggests that an instance of DOMErrorHandler 
is a parameter on the call to validateDocument.  If it were then there 
would be no need to reference the definition of DOMConfiguration. 

If the intention to cast the document to DOMConfiguration and call the 
setParameter("error-handler", errorHandler), then you would need to 
define what would occur if setParameter("schema-location",...) was 
called after loading but before calling validateDocument.  Changing the 
schema locations after document construction could be so disruptive that 
you may want to prevent it and use importNode when you want to recreate 
a document with a different schema.  If DOMConfiguration was then only 
used as part of document loading, it might be moved from Core to Load/Save.

My current preference is to define validateDocument as:

boolean validateDocument(DOMErrorHandler errorHandler)

Received on Tuesday, 3 June 2003 00:56:01 UTC