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

Subject: [xsl] Three alternatives to draw XML described mathematical equations in SVG
From: Luis Vielva <luisvielva@xxxxxxxxx>
Date: Mon, 14 Nov 2005 19:55:21 +0100
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