Re: [Simple-support] SimpleXML and MathML
Brought to you by:
niallg
|
From: Niall G. <gal...@ya...> - 2012-04-03 14:38:50
|
See @ElementUnion, @ElementListUnion, @ElementMapUnion, I think this might solve your problem, you just need to ensure the Apply class can cope with different operators and parameters using different classes, I think it should work. --- On Mon, 2/4/12, Dave Murray-Rust <D.M...@ed...> wrote: From: Dave Murray-Rust <D.M...@ed...> Subject: [Simple-support] SimpleXML and MathML To: sim...@li... Received: Monday, 2 April, 2012, 4:29 AM 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. ------------------------------------------------------------------------------ This SF email is sponsosred by: Try Windows Azure free for 90 days Click Here http://p.sf.net/sfu/sfd2d-msazure _______________________________________________ Simple-support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simple-support |