Subject:Translating svg path data to x,y Author:Kurt Martin Date:31 Aug 2006 09:51 AM
I am creating an XSLT to convert some XML data to SVG. The data is
exported from a program the customer is using, and it exports text
data, but the actual SVG text is written out as paths. I need to
find the x,y data in path/@d so I can position the text properly on
the screen. Here is a snippet of code:
Subject:Translating svg path data to x,y Author:Kurt Martin Date:01 Sep 2006 06:02 AM
From the path element, d attribute:
<path d="M556.42 509.02L556..."/>
should be:
<text x="556.42" y="509.02">text_value</text>
The placement of the lower, left corner is where the text should be placed, so the strings contain between "M" and "L", delimited by a space, should be placed into x and y respectively.