A list for the developers of CellML tools

Text archives Help


[cellml-dev] using InputFormatToMathML


Chronological Thread 
  • From: lpsmith at spod-central.org (Lucian Smith)
  • Subject: [cellml-dev] using InputFormatToMathML
  • Date: Wed, 11 Aug 2010 01:06:11 +0100

* Andrew Miller <ak.miller at auckland.ac.nz> [2010-08-10 00:28] writes:
>
> Create a cellml_api::CellMLBootstrap (platform specific - I'm sure you
> already know the XPCOM specific method). Call it cb.
> model <- cb.createModel(widestring "1.1")
> modelDE <- model.QueryInterface(interface cellml_api::CellMLDOMElement)
> docEl <- modelDE.domElement
> doc <- docEl.ownerDocument

Success! Thank you! I had actually tried (and failed) to find something
that would give me the document from an element--the fact that it's on
Node, which is *not* a base class of anything else in the API is pretty
annoying, and the solution above, while it works, is remarkably arcane.
Where would someone even start looking in the documentation to discover
this? Maybe it's an artifact of using the OpenCell bits. Anyway...

Speaking of the OpenCell bits, I have found that if the string I send
InputFormatToMathML is wrong (if I send it 'x^2' instead of 'pow(x,2)',
for example), it still returns 'success', but then sets the XML element to
'error'. This is pretty surprising! And also illegal CellML. I'm ending
up with:

<math xmlns="http://www.w3.org/1998/Math/MathML";>
<error xmlns="http://www.cellml.org/tools/mathml-input/error#"; column="17"
problem="syntax error"/>
</math>

Is there any way besides checking to see if the root element name is
'error' to check for success? If the only two options are to get 'apply'
or 'error' I can work with that; just want to be sure that's the intended
design.

-Lucian




Archive powered by MHonArc 2.6.18.

Top of page