This is a discussion on "XML to SVG (with xsl)" within the Other Programming Languages section. This forum, and the thread "XML to SVG (with xsl) are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
XML to SVG (with xsl)
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
XML to SVG (with xsl)
Hello,
I am new here and I would like some help about a project I'm working on. I want to transform an xml document to an svg document. The xml xas some coordinates in the following form : <gml:LinearRing > <gml:coord ><gml:X >20</gml:X><gml:Y >20</gml:Y></gml:coord><gml:coord ><gml:X >40</gml:X><gml:Y >20</gml:Y></gml:coord><gml:coord ><gml:X >50</gml:X><gml:Y >30</gml:Y></gml:coord><gml:coord ><gml:X >40</gml:X><gml:Y >40</gml:Y></gml:coord><gml:coord ><gml:X >20</gml:X><gml:Y >40</gml:Y></gml:coord><gml:coord ><gml:X >10</gml:X><gml:Y >30</gml:Y></gml:coord></gml:LinearRing> The number of this coords is undefined... ... I want to take this coordinates and use them as an attribute to the next svg shape: <g> <polygon fill="green" stroke="blue" stroke-width="2" points= 20 20, 40 20, 50 30..../> </g> How can I get this coordinates as one string and use them in the above "points" attribute? Thank you! |
|
|
|
#2
|
||||
|
||||
|
Re: XML to SVG (with xsl)
There may be a way of doing this with XSLT, but that is not my strongest point to be honest. It should be fairly easy to use an XML parser in a server side scripting language (like ASP, PHP) to read all this in and transform it into your SGML string. You could even do it with fairly basic string manipulation functions and arrays to parse the XML content.
Either way, you can post in the relevant scripting forum for further direction.
__________________
Click the 'Thanks!' button if this post has helped you Rob - Webforumz Founder
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
![]() |
| Tags |
| xml, svg, xsl |
| Thread Tools | |
|
|