Re: validation and exception handling

Steve,
I think you make a good point.

In the DOM2 spec, there are comments with some of the attributes that says
things like:

     attribute DOMString cssText; 
        // raises(DOMException) on setting

The SVG spec needs to have similar comments around attributes which might
raise an exception (and we might also want to give a hint about what
particular exceptions might be raised, which DOM2 doesn't seem to do). 

Jon Ferraiolo
SVG Editor
Adobe Systems Incorporated

At 10:23 AM 5/24/00 -0700, Steve Dickson wrote:
>
>In the current draft of the spec, there is very little provision for data
>validation on most of the attribute set/mutator functions.  There seems to
>be a tacit assumption that the data provided by the user will be
>well-formed and valid.  To give a concrete example, the SVGGradientElement
>interface contains an attribute gradientUnits which takes one of the
>constants defined in SVGUnitTypes.  The SVGUnitTypes interface states that
>it is invalid to attempt to assign an attribute a value of
>SVG_UNIT_TYPE_UNKNOWN.  However, no mechanism is provided in the spec to
>inform a user attempting to assign this value that they are performing an
>invalid or illegal operation.  This is one example, though there are many
>more.  In fact, the instances where a warning is raised on invalid data
>are the exception rather than the rule (pardon the pun).
>
>Is a more rigourous data validation and exception handling mechanism
>likely to be added?  If not, I think it's almost inevitable that
>implementors are going to break/extend the spec by adding their own.  
>
>S.
> 
> 

Received on Wednesday, 24 May 2000 22:41:23 UTC