PDA

View Full Version : VBA and XML::Conversion of Sorts



Saladsamurai
08-20-2009, 08:34 AM
Hello! :hi:

I am extremely new to all of this, so please forgive me if I am too vague. I will do my best.

I need a way to convert MathML into a more Excel-Usable form. Here is a specific example of what I would like to do. Though it is a very simplified one at that:

I have a MathML generated equation such as:

http://i12.photobucket.com/albums/a220/saladsamurai/math.jpg



which is exported in MathML as:

<math xmlns='http://www.w3.org/1998/Math/MathML'
mathematica:form='StandardForm'
xmlns:mathematica='http://www.wolfram.com/XML/'>
<mrow>
<mi>T2</mi>
<semantics>
<mo>→</mo>
<annotation encoding='Mathematica'>&quot;\[Rule]&quot;</annotation>
</semantics>
<mrow>
<mo>-</mo>
<mfrac>
<mrow>
<mrow>
<mrow>
<mo>-</mo>
<mi>K1</mi>
</mrow>
<mo>⁢</mo>
<mi>K4</mi>
</mrow>
<mo>-</mo>
<mrow>
<mi>K3</mi>
<mo>⁢</mo>
<mi>K5</mi>
</mrow>
</mrow>
<mrow>
<mrow>
<mo>-</mo>
<mi>K3</mi>
</mrow>
<mo>+</mo>
<mrow>
<mi>K2</mi>
<mo>⁢</mo>
<mi>K4</mi>
</mrow>
</mrow>
</mfrac>
</mrow>
</mrow>
</math>

Now I would like to convert the MathML into a form that can be placed in the function line in an Excel worksheet. That is, it should look more like

T2 = (-(K1*K4*)-(K3*K5))/(-K3+K2*K4)

Any ideas?

Saladsamurai
08-31-2009, 04:41 AM
Anyone out there with experience in this? :help

mdmackillop
08-31-2009, 05:48 AM
I don't see how this could be handled with VBA. I would look at an Export from MathML