Question: MW file format specification

Hi,

I am currently writing a Python program which takes a Maple Worksheet and evaluate the commands in the terminal version of Maple. However, I have trouble figuring out how the input is formatted. As an example I have following XML code in a .mw file:

<Input><Text-field prompt="&gt; " style="Maple Input" layout="Normal">
<Equation executable="true" style="2D Input" input-equation="A := 4;"
display="LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5n\
R0koX3N5c2xpYkdGJzYuLUkjbWlHRiQ2JVEiQUYnLyUnaXRhbGljR1EldHJ1ZUY\
nLyUsbWF0aHZhcmlhbnRHUSdpdGFsaWNGJy1JI21vR0YkNi1RKiZjb2xvbmV\
xO0YnL0YzUSdub3JtYWxGJy8lJmZlbmNlR1EmZmFsc2VGJy8lKnNlcGFyYXRv\
ckdGPS8lKXN0cmV0Y2h5R0Y9LyUqc3ltbWV0cmljR0Y9LyUobGFyZ2VvcEdGPS\
8lLm1vdmFibGVsaW1pdHNHRj0vJSdhY2NlbnRHRj0vJSdsc3BhY2VHUSwwLjI3\
Nzc3NzhlbUYnLyUncnNwYWNlR0ZMLUkjbW5HRiQ2JFEiNEYnRjktRjY2LVEiO0Yn\
RjlGOy9GP0YxRkBGQkZERkZGSC9GS1EmMC4wZW1GJ0ZNLUknbXNwYWNlR0\
YkNiYvJSdoZWlnaHRHUSYwLjBleEYnLyUmd2lkdGhHRlgvJSZkZXB0aEdGaG4vJ\
SpsaW5lYnJlYWtHUShuZXdsaW5lRictRjY2LVEifkYnRjlGO0Y+RkBGQkZERkZGS\
EZXL0ZORlgtRiw2JVEiQkYnRi9GMkY1LUZQNiRRIjdGJ0Y5RlMvJStleGVjdXRhYm\
xlR0Y9Rjk=">QyY+SSJBRzYiIiIlIiIiPkkiQkdGJSIiKEYn</Equation>
</Text-field>
</Input>

One notices immediately that the input is given as the attribute "input-equation" which in this case is "A :=4;". However, when the worksheet is opened in the graphical version of Maple it is seen that the real input is "A:=4;[shift+enter]B:=7;". My question is: How do I recover the full input from XML code? Remark: "B:=7" does not occur anywhere in XML, yet Maple displays and evaluates it when Maple is opened:

Image of graphical Maple input

 

For the record I am using Maple 13, but I am interested in doing this independently of the Maple version. Thanks in advance.

Troels

Please Wait...