XML to SVG (with xsl)

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.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > Other Programming Languages

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Nov 13th, 2005, 12:17
New Member
Join Date: Nov 2005
Location: Greece
Age: 24
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
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!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Nov 13th, 2005, 20:08
Rob's Avatar
Rob Rob is online now
Webforumz Founder
Join Date: Jul 2003
Location: Southern UK
Age: 34
Posts: 3,194
Blog Entries: 7
Thanks: 27
Thanked 24 Times in 21 Posts
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
xml, svg, xsl

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 20:41.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved