RE: [xsl] Three alternatives to draw XML described mathematical equations in SVG

Subject: RE: [xsl] Three alternatives to draw XML described mathematical equations in SVG
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Tue, 15 Nov 2005 00:31:37 -0000
I think (iii) is probably doable using Dimitre Novatchev's FXSL library. If
you're comfortable with functional programming, or prepared to learn, then
this is probably an excellent way to tackle the problem. It's likely to be a
bit of an intellectual challenge: let us know how you get on.

Michael Kay
http://www.saxonica.com/ 

> -----Original Message-----
> From: Luis Vielva [mailto:luisvielva@xxxxxxxxx] 
> Sent: 14 November 2005 18:55
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] Three alternatives to draw XML described 
> mathematical equations in SVG
> 
> My problem is to draw with SVG a mathematical function described in
> an XML file and to animate a point on the 2D curve. The 
> mathematical function
> will be fixed for a given XML element.
> 
> I am considering three alternatives:
> 
> i) To describe the points of the 2D curve in the XML and to 
> build a SVG path
> element via XSLT with the given points.
> 
> ii) To describe the equation in the XML and to transform with 
> XSLT into an
> SVG file that uses JavaScript to evaluate the equation on the 
> onload event
> and to dynamically build the subset of the SVG DOM.
> 
> iii) To describe the equation in the XML and to use XSLT / 
> XPATH to evaluate
> the equation and to build the SVG with the correct path 
> element, not needing
> JavaScript for the task.
> 
> 
> I think that I would have no problem in using any of the two 
> first approaches.
> I do not know if the third approach is even feasible (been 
> the main problem
> I see how to evaluate the expression in XSLT / XPATH). 
> However, if it is
> possible, the third one seems to me the most elegant solution.
> 
> Could anyone provide me some clue on the problem?
> 
> 
> Best regards,
> 
> Luis Vielva.

Current Thread