Pavan (Akkisetty Venkata Sai Pavan Kumar) wrote:
> I am not sure if evaluate( )-mathod will do non-numeric evaluations. I
> see that your mathml is non-numeric in nature (I mean symbolic).
> This is the output I get if I use Mathematica to interpret your mathml.
Ok, that was a confusing example. The following should be possible to compute:
<math xmlns="http://www.w3.org/1998/Math/MathML">
<apply>
<sum/>
<bvar><ci>i</ci></bvar>
<lowlimit><cn>0</cn></lowlimit>
<uplimit><cn>100</cn></uplimit>
<apply>
<power/>
<cn>2</cn>
<ci>i</ci>
</apply>
</apply>
</math>
Now there's an exception: "Exception in thread "main"
java.lang.ClassCastException: java.lang.String"
> I am also trying to use JSci to convert mathml to Jsci objects. Can you
> send me an example code if you have any?? I couldn't understand how to
> use MathMLDOMimpl library.
Yes, it's really difficult to see how the library works.
import JSci.mathml.MathMLApplyElementImpl;
import JSci.io.MathMLExpression;
public class TestJSci {
/**
* @param args
*/
public static void main(String[] args) {
JSci.io.MathMLParser parser = new JSci.io.MathMLParser();
try {
parser.parse("test.mml");
} catch (Exception e) {
System.out.println(e.getMessage());
}
Object parseList[] = parser.translateToJSciObjects();
for (int i = 0; i < parseList.length; i++) {
JSci.io.MathMLExpression test = (JSci.io.MathMLExpression) parseList[i];
System.out.println(test.evaluate());
System.out.println(test.getOperation());
}
}
}
Regards, Herbert
___________________________________________________________
Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de