[techexplorer-support] Re[2]: <mstyle> problem

Aleksey news4al at freemail.ru
Wed Jul 13 01:26:26 MDT 2005


Hello Sam,

I have found another issue. I can set mathbackground attribute of
mstyle tag in html file. But if I change it programmatically nothing
happens.

Please see a small sample:
-----------------------------------------------------------
<html xmlns:m>
<head>
<object name="mml" classid="clsid:0E76D59A-C088-11D4-9920-002035EFB1A4"></object>
<?import namespace="m" implementation="#mml" ?>
<title>Integre Techexplorer Testbed</title>
<script language="JavaScript" type="text/javascript">
function handleClick() 
{
        var elts = document.getElementsByTagName("math");
        var math = elts[0];

        var o = document.getElementById("outer");
        var i = document.getElementById("inner");
        var color1 = o.mathbackground;
        var color2 = i.mathbackground;
        o.mathbackground = color2;
        i.mathbackground = color1;

        math.validateMml();
        //alert(math.innerHTML);
}
</script>
</head>
<body>
<h2>Scripting</h2>
<div>
    <m:math>
    <m:mstyle id="outer" mathbackground="green">
    <m:mrow>
        <m:mo>(</m:mo>
        <m:mstyle id="inner" mathbackground="yellow">
        <m:mrow>
            <m:mi>a</m:mi>
            <m:mo>+</m:mo>
            <m:mi>b</m:mi>
        </m:mrow>
        </m:mstyle>
        <m:mo>)</m:mo>
    </m:mrow>
    </m:mstyle>
    </m:math>
</div>
<p><form>
    <input type="button" value="Swap a and b" onClick="handleClick()">
</form></p>
</body>
</html>
-----------------------------------------------------------

As you can see the attributes are changed but validateMml doesn't redraw
that changes correctly.

Are there another way to change mathbackground of expression programatically?

BTW, depricated (in MathML 2.0) "background" attribute seems to be
ignored at all even in html code. Although out-of-date
documentation
http://www.integretechpub.com/docs/techexplorer/Help/CompatibilityMain.html#MathML

states that it is supported.

-- 
Best regards,
 Aleksey                            mailto:news4al at freemail.ru




More information about the techexplorer-support mailing list