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.



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

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
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!
Reply With Quote

  #2 (permalink)  
Old Nov 13th, 2005, 20:08
Rob's Avatar
Rob Rob is offline
Head Admin & CEO

SuperMember
Join Date: Jul 2003
Location: at my desk
Age: 34
Posts: 2,953
Blog Entries: 7
Thanks: 7
Thanked 3 Times in 3 Posts
Send a message via MSN to Rob Send a message via Skype™ to Rob
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.
__________________
Rob - SEO Specialist
Owner & Founder of Webforumz.com

I am currently unavailable for private work
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 01:22.


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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43