A list for the developers of CellML tools

Text archives Help


[cellml-dev] using InputFormatToMathML


Chronological Thread 
  • From: j.marsh at auckland.ac.nz (Justin Marsh)
  • Subject: [cellml-dev] using InputFormatToMathML
  • Date: Tue, 20 Jul 2010 15:39:30 +1200

Hi Lucian,

My apologies for the delay in replying. InputFormatToMathML does
require a real domIDocument*, as this is used to generate the output
domIElement*; domIElements must be resident in a domIDocument.

If you have a domIDOMImplementation di, you should be able to use
something like

nsCOMPtr<domIDocumentType> dt;
nsCOMPtr<domIDocument> doc;
nsCString model("model"), none("");
rv = di->CreateDocumentType(model, none, none, getter_AddRefs(dt));
rv = di->CreateDocument(none, model, dt, getter_AddRefs(doc));

You can get a domIDOMImplementation object from (for example)
cellml_apiICellMLBootstrap::DomImplementation

Best Regards,
Justin.

Quoting Lucian Smith <lpsmith at spod-central.org>:

> ...anyone?
>
> * Lucian Smith <lpsmith at spod-central.org> [2010-07-15 21:55] writes:
>> So, I have the following code:
>>
>> nsCOMPtr<domIElement> mathml;
>> nsCString formstring("x = y");
>> MathMLInputServices mmlis;
>> rv = mmlis.InputFormatToMathML(NULL, formstring,
>> getter_AddRefs(mathml));
>>
>> The return code is 2147942487, which if I translate to hex, I can find is
>> either "NS_ERROR_ILLEGAL_VALUE" or "NS_ERROR_INVALID_ARG". *Which*
>> argument, it won't tell me, but I'm guessing it's the NULL.
>>
>> Now, when I was translating the other way, NULL was fine:
>>
>> rv = mmlis.MathMLToInputFormat(input, NULL, indent, cinfix);
>>
>> but, I suppose, no longer.
>>
>> Since InputFormatToMathML is from OpenCell, not the API, I don't have any
>> documentation at all, so I turn to you all and ask: am I right that it
>> requires a real 'domIDocument*'? And if so, how do I go about making one?
>> Do I make (I assume) a mathml_domIMathMLDocument and cast it? Is there a
>> mathml_domIMathMLDocument factory somewhere?
>>
>> -Lucian
>> _______________________________________________
>> cellml-tools-developers mailing list
>> cellml-tools-developers at cellml.org
>> http://www.cellml.org/mailman/listinfo/cellml-tools-developers
> _______________________________________________
> cellml-tools-developers mailing list
> cellml-tools-developers at cellml.org
> http://www.cellml.org/mailman/listinfo/cellml-tools-developers
>



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.





Archive powered by MHonArc 2.6.18.

Top of page