[Simple-support] SimpleXML and MathML
Brought to you by:
niallg
|
From: Dave Murray-R. <D.M...@ed...> - 2012-04-02 11:30:08
|
Hi, I'd like to use SimpleXML to build class hierarchies from MathML - I've been using simple for a while, and I don't like having to go back to the standard XML ways of doing things. However, it seems like MathML is difficult to deal with. Each element can contain arbitrary MathML structures, and the element names change depending on what the element is. So as an example: <m:apply> <m:minus/> <m:cn>3</m:cn> <m:ci>x</m:ci> </m:apply> This should be 3-x. The issue I'm having is: * an apply can have any number of children * the children can all have different names I can deal with the element names and namespaces in isolation, so I can manage linking <m:ci> with a Variable class. I can't figure out any annotations I could add to an Apply class, though, which would let it pick up a bunch of different elements. <m:minus> could be all sorts of other things, <m:cn> could be another <m:apply> with it's own set of content etc. I'm starting to feel that this is so far outside what Simple deals with, that it will get too complicated. But, if there's a nice elegant solution, that would be fantastic. Cheers, dave -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. |