Re: Engineering application using XML, XSLT, SVG & MathML (maybe)

> Amit Jain wrote:

> Now the conundrums:
> I am thinking that since it is the same data that is presented in two
> different ways, I can modify my program to output an XML file (using a
> private schema) and I can convert this with XSLT to either HTML, MathML
> or SVG. But I haven't ever coded XML before, so I want to know if all
> this is feasible and whether the technologies are mature enough to be
> able to cope with all this. 

The answer is yes and no. Yes you can output your calculations in XML, yes
you can have the numerical results in XML and yes you can display the
drawing in XML (using SVG).

The trick is whether you can convert whatever your calculations outpiut
into an engineering drawing; there the limitations are not XML but the
processing technology that you are using for the conversion and how
automatically thje geometry follows from the calculations.

> And what would the best platforms to
> parse/display/print the XML be. I have some misgivings about whether SVG
> provides enough functionality to cope with non-trivial drawings that
> involve scaling/rotation/translation of entities 

SVG can easily deal with translation, rotation and scaling of graphical
elements. This is extremely basic functionality.

> (I read an SVG tutorial
> at IBM's website, and they said that they can't use SVG to generate 

SVG does not generate things; it is what something generates.

> even
> a simple pie chart from 3 data sets as it doesn't support mathematical
> functions).

This is bogus; SVG can clearly be used to draw a pie chart! 

SVG with script can be used to draw a pie chart on the fly, and there is an
example in the SVG Test Suite which does exactly that.  

The issue is not with SVG itself but with whatever technology you are using
to convert from your calculations to SVG. For example, your calculations
ight give the wall thickness at certain discrete points and you would then
need to calculate a smooth curve that passes through those points while
obeying whatever criteria (maximum rate of change, minimum total weight,
whatever) that you need. Having descibed that curve, for example as a
series of continuous bezier segments, it can then easily be output to SVG.

In the case of a full programming language (Java, C, ECMAScript) any DOM
manipulation can be done and it is just a case of whether you know how (or
have libraries that know how) to calculate your desired geometry; once you
have the geometry then SVG can express it. In the case of XSL-T for
example, you will have a harder time (but help is available, take a look at
what SchemaSoft has done in the area of math libraries for XSL-T).

>  Also, I don't know a priori what size of paper I would be
> printing on.

You don't need to. You just give the aspect ratio and the file prints as
big as it can.

>  Is it possible to query the display size from whichever
> application is going to display SVG/HTML/MathML and format my output
> accordingly ? Oh, and finally, does MathML support mixed mode output,
> like:
> 
> Solution to this quadratic equation = [formula here] = 5.4

That is a mix of MathML and some other grammar that can store text, which
can be pretty much anything.

-- 
Chris

Received on Friday, 2 March 2001 15:28:59 UTC