Re: mandatory "d" attribute on <path>

Ben Hutchings wrote:
> 
> I am curious as to why the "d" attribute is mandatory for <path>.  If I
> want to output an arbitrarily long path, I have to be able to output
> child <data> elements.  However, because the "d" attribute is
> mandatory, I also have to put some path data (or maybe just an empty
> string) on the parent <path> element.  This seems very ugly.

Right. The problem is, that for the common case where the path data is
on the d attribute of the path element itself, if we made it optional,
then the parser could not detect that there was no path data. XML DTDs
do not allow one to express constraints of the form "there must be a d
attribute, unless there is at least one data child with a d attribute".

The other option would be to *never* allow d on path and always require
the data element to be used. But that also seems ugly.

All this arises because of the 1023-character restriction on the length
of a d attribute value; it s not clear whether this limit actually helps
either legibility or processing with some XML-aware tools such as Perl.

The SVG WG is however already looking at this issue, so keep an eye out
for the next public draft and let us know if you think it is an
improvement in this area.

--
Chris

Received on Wednesday, 28 July 1999 19:57:21 UTC