http://qs1969.pair.com?node_id=190002


in reply to Interfacing Perl and SVG

If you're doing the highlighting client-side (via rollovers) I'd just use the SVG DOM for it. Unfortunately perl doesn't have a fully capable SVG parser yet (though AxPoint contains an SVG path parser which you may find useful - that's probably the hardest part), so in order to get at those bits you're better off doing it client side.

Unlike HTML, SVG has a very stable client-side Javascript spec, and works very well in the Adobe viewer (using the mozilla javascript engine).

If that doesn't cover what you're after, then yes, parse with a SAX parser and extract the paths. I don't know how they'll be done in your SVG (there are various different ways in SVG to define a path).

The other thing to do is to hand-refine your SVG, so that each region is a <g> group. Then you can do funky things with those groups like enlarge and bring them forward as you mouse over them. There's been some good examples of this on XML.com.