BizTalk Utilities CV ,   Jobs ,   Code library
 
Home Page


Add/Edit your code items
Search the code library
Browse for the code library


XSLT
Using XSLT to produce SVG (2)
Performance Tuning XSLT - Part 1
Performance Tuning XSLT - Part 2
Performance Tuning XSLT - Part 3
Performance Tuning XSLT - Part 4
Using XSLT to produce SVG (3)
XPath as parameters
Table with more than one column
Create an N-Column Table from XML node-set
Finding ""the corresponding node"" in a parallel subtree
Get the last item from a delimited list
Limitation to Muenchian method.
Find the number of tokens or words in a string
Randomization of node-sets or node-lists
XPath Analyzer
Finding the Maximum Date
World Cup 2002 fever hits XSLT!!
Using XSLT for DHTML Menus
RSS / RDF Newsfeed Reader
Hierarchical menu from Database + XSL to Html


 
 

<< XQuery.NET and XML >>


By Martin Rowlinson (aka Marrow)
First Posted 03/07/2002
Times viewed 315

Using XSLT to produce SVG (1)


This post contains attachments
v20020307073628.zip 

Summary Using XSLT to produce a simple graph from XML data.

To try this code in Xselerator, please install the 30 day demo version of MarrowSoft Xselerator.

I must confess - I think SVG is one of the greatest things since sliced bread! :-)

Combining the power of SVG with the capabilities of XSLT to produce dynamic graphics (e.g. graphs) from XML data is truly excellent - we just need to wait for SVG to be more widely supported by browsers (by default - at the moment it can only be done with the use of plug-ins, e.g. the Adobe SVG Viewer http://www.adobe.com/svg/viewer/install/main.html).

So I've been having a play with using SVG in combination with XSLT to produce some very rudimentary graphs.  I'm no SVG whiz so my SVG code may not be the best - and I'd appreciate comments if any experts out there can see that my SVG coding is way off beam!

The one small complaint I have with SVG is the @d attribute of the <svg:path> element - I have found the commands to be used in this attribute a little hard to write and even harder to read.  My wish for SVG is that the path definitions be more XML like, for example rather than...

  <svg:path d=M 20,10 h10 v10 h-10 v-10/>

I would rather do something like...

  <svg:path>
    <svg:d movetoX=20 movetoY=10/>
    <svg:d linetoX=10/>
    <svg:d linetoY=10/>
    <svg:d linetoX=-10/>
    <svg:d linetoY=-10/>
  </svg:path>

Yes, it would be more verbose - but a lot easier to write and read (and correct).
Maybe this is something that has been addressed in SVG1.1 - but I couldn't see any direct evidence of it.

Anyway, my rudimentary attempts are shown below - do let me know what you think.

Cheers - Marrow

Additional information


Rate this article on a scale of 1 to 10 (0 votes, average 0)

Your vote :  

<< XQuery.NET and XML >>





Leave a comment for this article
Your name
Your email (optional)
Your comment
Optional: Upload an attachment
Enter the code shown:

 
 

    Email TopXML