Haskell SVG path parser?

Hi, Does there exist any Haskell package/library to parse the syntax of SVG elements, esp. PATH? That is, the syntax of the "d" attribute (e. g. M 100 100 L 300 100 L 200 300 z)? Hackage doesn't seem to have any, and Google search yields very broad results. Thanks. PS It should not be hard to write such parser, I just don't want to reivent the wheel ;) -- Dimitry Golubovsky Anywhere on the Web

On Mon, 24 May 2010, Dimitry Golubovsky wrote:
Does there exist any Haskell package/library to parse the syntax of SVG elements, esp. PATH?
That is, the syntax of the "d" attribute (e. g. M 100 100 L 300 100 L 200 300 z)?
Hackage doesn't seem to have any, and Google search yields very broad results.
Once I wrote such a function in order to convert an SVG path to PDF. See parsePath in http://code.haskell.org/~thielema/internetmarke/src/Main.hs

Henning,
Thanks, I'll try to use your code.
BTW does it handle the syntax where repeated operation is omitted, per
SVG spec 8.3.1?
--------------------------------------------------------------------------------------------------
The command letter can be eliminated on subsequent commands if the
same command is used multiple times in a row (e.g., you can drop the
second "L" in "M 100 200 L 200 100 L -100 -200" and use "M 100 200 L
200 100 -100 -200" instead).
--------------------------------------------------------------------------------------------------
see http://www.w3.org/TR/SVG11/paths.html#PathDataGeneralInformation
On Mon, May 24, 2010 at 10:43 AM, Henning Thielemann
[skip]
Once I wrote such a function in order to convert an SVG path to PDF. See parsePath in http://code.haskell.org/~thielema/internetmarke/src/Main.hs
-- Dimitry Golubovsky Anywhere on the Web
participants (2)
-
Dimitry Golubovsky
-
Henning Thielemann