#REQUIRED attributes

Certain SVG element types contain attributes that are #REQUIRED e.g.
SVGSVGElement attributes 'width' and 'height', SVGCircleElement 'r'
attribute, etc.  However, there currently isn't any mechanism in the SVG
spec to ensure that these attributes are set (though I understand that
some sort of DTD validation mechanism will be part of the DOM3 spec).  
Given that these attributes _must_ be set at some point, wouldn't it make
sense for 
these attribute values to be passed as parameters to the appropriate
factory methods?  e.g. 

...
SVGSVGElement svg;
...
SVGLength r = svg.createSVGLength();
r.setValue(10.0);
svg.createSVGCircleElement(r);
...

This would ensure that all #REQUIRED attributes are set when the element
is created. 

 Note: SVGSVGElement would need to be bootstrapped, since it contains
#REQUIRED attributes 'width' and 'height' of type SVGLength and the
SVGLength factory method is contained in SVGSVGElement.

S.

Received on Monday, 29 May 2000 13:37:10 UTC