Bonjour tout le monde,

J'essai de parser un fichier MathML avec JSci. Mon parser lit le fichier, mais il m'est impossible d'effectuer une transformation des objetsorg. w3C.dom.ElementNS en JSci.mathml.MathMLElement.

Quelqu'un aurait il une idée?

Voici mon code:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 
try {
	FileInputStream stream = new FileInputStream(new File("test.mml"));
	InputSource src = new InputSource(stream);
	MathMLParser parser = new MathMLParser();
	parser.parse(src);
	Object[] objList = parser.translateToJSciObjects();
 
 
	/*
	* Même probleme avec cette méthode:
	*
	* MathMLDocumentImpl doc = (MathMLDocumentImpl)parser.getDocument();
	* MathMLParser.translateToJSciObjects(doc);
	*/	
 
} catch (FileNotFoundException e) {
	e.printStackTrace();
} catch (SAXException e) {
	e.printStackTrace();
} catch (IOException e) {
	e.printStackTrace();
}
et voici mon fichier MathMl (.mml)
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
 
<?xml version="1.0"?>
<math>
<mi>x</mi>
<mo>=</mo>
<mi>a</mi>
<mo>+</mo>
<mi>b</mi>
</math>