W3C home > Mailing lists > Public > www-svg@w3.org > October 2003

setting an svg path attribute should raise an error on invalid path.

From: Jim Ley <jim@jibbering.com>
Date: Wed, 29 Oct 2003 21:55:48 -0000
To: www-svg@w3.org
Message-ID: <bnpd32$gd5$1@sea.gmane.org>


Imagine in some future time when someone developed a path syntax that was
somewhat similar, but not quite identical to the current SVG path attribute,
perhaps it added some new functionality.

If I wanted to author an implementation of this within script in SVG
(perhaps with RCC) then I'd be forced to parse the d attribute myself even
though only maybe 1 in 1000 actually used this new syntax, the rest were
identical.  To make this easier, I'd like

el.setAttributeNS(null, "d","Y 10")

To throw an error (which I could then catch and only use my slow parser when
the syntax differs.)

This might be a little troublesome as it's just using setAttributeNS and
modifying this to throw such errors may not be ideal.  So a
createSVGPath(str) method on a path may be more appropriate and that could
throw the error.

Received on Wednesday, 29 October 2003 16:59:21 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:29:20 UTC