So I perform some operation like
out := Minimize(function(param1, paramN));
from this I getsomething like array of pairs Name=Value printed out
and than I do:
assign(out[2]);
I want to print out[2] into xml in a way like
<param1>
value
</param1>
...
<paramN>
value
<ParamN>
How to do such开发者_C百科 thing (how to print anarray of pairs Name=Value into XML in desired form- not in mathML?)?
Have you tried using XMLTools package?
Documentation: Overview of the XMLTools Package
You can also check these examples (in an earlier version, but I suppose the logic is there)
EDIT:
quick example (I haven't used XMLTools before, but I think it's not far):
(out[1] contains names and out[2] values)
> with( XMLTools );
> doc := XMLElement("params", [], seq(XMLElement(out[1][i], [], out[2][i])))
> print(doc)
<params>
<param1>value1</param1>
...
<paramN>valueN</paramN>
</params>
精彩评论