472,975 Members | 1,650 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,975 software developers and data experts.

What can be used to update a MathML page in Mozilla browsers?

DKM
I need an equivalent for the following:

document.getElementById('equation').update(); from Mathplayer

to use it in Mozilla based browser.

When I change any text node, the page updates just fine in FireFox.
However, if I change an entire math element, as in the following:

eqElement = document.getElementById("equation");
a2Element = document.createElement("msup");
baseElement = document.createElement("mi");
powerElement = document.createElement("mo");
baseElementText = document.createTextNode("a");
powerElementText = document.createTextNode("2");
baseElement.appendChild(baseElementText);
powerElement.appendChild(powerElementText);
a2Element.appendChild(baseElement);
a2Element.appendChild(powerElement);
eqElement.appendChild(a2Element);
it does not update the page.

It does not update in Internet Explorer running Mathplayer either.
However, if I follow up the above code with the following:

document.getElementById('equation').update();

it works just fine.

The file is a XML file with the following declaration:

<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN"
"http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd"
[<!ENTITY mathml "http://www.w3.org/1998/Math/MathML">
]>
<html xmlns="http://www.w3.org/1999/xhtml">

I will appreciate it if someone can she some light on this.

Thanks in advance.

D. K. Mishra

Jul 24 '05 #1
7 1816
In article <11*********************@o13g2000cwo.googlegroups. com>,
"DKM" <de**************@hotmail.com> wrote:
However, if I change an entire math element, as in the following: it does not update the page.


Then there's a bug. You could try making the entire block that encloses
the equation display: none; and then restoring it to display: block;.

--
Henri Sivonen
hs******@iki.fi
http://hsivonen.iki.fi/
Mozilla Web Author FAQ: http://mozilla.org/docs/web-developer/faq.html
Jul 24 '05 #2
In article <11*********************@o13g2000cwo.googlegroups. com>,
"DKM" <de**************@hotmail.com> wrote:
However, if I change an entire math element, as in the following: it does not update the page.


Then there's a bug. You could try making the entire block that encloses
the equation display: none; and then restoring it to display: block;.

--
Henri Sivonen
hs******@iki.fi
http://hsivonen.iki.fi/
Mozilla Web Author FAQ: http://mozilla.org/docs/web-developer/faq.html
Jul 24 '05 #3
In article <11*********************@o13g2000cwo.googlegroups. com>,
"DKM" <de**************@hotmail.com> wrote:
However, if I change an entire math element, as in the following: it does not update the page.


Then there's a bug. You could try making the entire block that encloses
the equation display: none; and then restoring it to display: block;.

--
Henri Sivonen
hs******@iki.fi
http://hsivonen.iki.fi/
Mozilla Web Author FAQ: http://mozilla.org/docs/web-developer/faq.html
Jul 24 '05 #4
In article <11*********************@o13g2000cwo.googlegroups. com>,
"DKM" <de**************@hotmail.com> wrote:
However, if I change an entire math element, as in the following: it does not update the page.


Then there's a bug. You could try making the entire block that encloses
the equation display: none; and then restoring it to display: block;.

--
Henri Sivonen
hs******@iki.fi
http://hsivonen.iki.fi/
Mozilla Web Author FAQ: http://mozilla.org/docs/web-developer/faq.html
Jul 24 '05 #5
DKM

DKM wrote:
I need an equivalent for the following:

document.getElementById('equation').update(); from Mathplayer

to use it in Mozilla based browser.

When I change any text node, the page updates just fine in FireFox.
However, if I change an entire math element, as in the following:

eqElement = document.getElementById("equation");
a2Element = document.createElement("msup");
baseElement = document.createElement("mi");
powerElement = document.createElement("mo");
baseElementText = document.createTextNode("a");
powerElementText = document.createTextNode("2");
baseElement.appendChild(baseElementText);
powerElement.appendChild(powerElementText);
a2Element.appendChild(baseElement);
a2Element.appendChild(powerElement);
eqElement.appendChild(a2Element);
it does not update the page.
A little correction here. It updates the math element. But, it does not
display it mathematically.

Starting from

<math id="eq1" xmlns="http://www.w3.org/1998/Math/MathML">
</math>

I get the following:

<math id="eq1" xmlns="http://www.w3.org/1998/Math/MathML">
<msup>
<mi>a</mi>
<mn>2</mn>
</msup>
</math>

Which is what I wanted. But, the browser does not display the math.

D.K. Mishra

It does not update in Internet Explorer running Mathplayer either.
However, if I follow up the above code with the following:

document.getElementById('equation').update();

it works just fine.

The file is a XML file with the following declaration:

<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN"
"http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd"
[<!ENTITY mathml "http://www.w3.org/1998/Math/MathML"> ]>
<html xmlns="http://www.w3.org/1999/xhtml">

I will appreciate it if someone can she some light on this.

Thanks in advance.

D. K. Mishra


Jul 24 '05 #6

Henri Sivonen wrote:
In article <11*********************@o13g2000cwo.googlegroups. com>,
"DKM" <de**************@hotmail.com> wrote:
However, if I change an entire math element, as in the following:
it does not update the page.


Then there's a bug. You could try making the entire block that

encloses the equation display: none; and then restoring it to display: block;.
It did not work. Funny thing is when I view the source code, I see the
mathml code as it should be like as follows:

<math id="eq1" xmlns="http://www.w3.org/1998/Math/MathML">
<msup>
<mi>a</mi>
<mn>2</mn>
</msup>
</math>

Yet, the browser is displaying "a2" instead of the true math
presentation of square.

For a change, I strated with a non-empty <math> tag as follows:

<math id="eq1" xmlns="http://www.w3.org/1998/Math/MathML">
<msup>
<mi>b</mi>
<mn>2</mn>
</msup>
</math>

and applied the scriptcode and it changed to

<math id="eq1" xmlns="http://www.w3.org/1998/Math/MathML">
<msup>
<mi>b</mi>
<mn>2</mn>
</msup>
<msup>
<mi>a</mi>
<mn>2</mn>
</msup>
</math>

But, it is displaying it as bsquared followed by a2 not a squared. In
otherwords, the browser is not displaying the updated math even after
changing display attribute as you suggested.

Thanks for your input. Maybe its abug, may be not. I don't know. I want
to know if there is a work around.

Interestingly, the browser updates just fine when I add simple html
tags using script code. Also, it updates just fine if I change a text
node inside mathml code.
Again, thanks.

D.K. Mishra

--
Henri Sivonen
hs******@iki.fi
http://hsivonen.iki.fi/
Mozilla Web Author FAQ:

http://mozilla.org/docs/web-developer/faq.html

Jul 24 '05 #7

Henri Sivonen wrote:
In article <11*********************@o13g2000cwo.googlegroups. com>,
"DKM" <de**************@hotmail.com> wrote:
However, if I change an entire math element, as in the following:
it does not update the page.


Then there's a bug. You could try making the entire block that

encloses the equation display: none; and then restoring it to display: block;.

Its working now. I was not including the name space when calling
createElement to creat an element. In another newsgroup, a gentleman
pointed that out and suggested that I call createElementNS that allows
you to include any namespace. Unfortuantely, Microsoft has not
implemented createElementNS, but I can't complain for its innerHTMl
makes it all easy.

Thank you for your help.

D.K. Mishra

--
Henri Sivonen
hs******@iki.fi
http://hsivonen.iki.fi/
Mozilla Web Author FAQ:

http://mozilla.org/docs/web-developer/faq.html

Jul 24 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Florian Huber | last post by:
Hello! i've got a Problem: I'd like to build a website, which contains HTML and MathML, but it should be readable for most of the site visitors. I know about the ways mentioned at the...
0
by: Bart Van Loon | last post by:
Hi, I am playing around with native MathML viewing in Mozilla and am wondering the following: When I name my file helloworld.xml the presentation <math> in it gets rendered correctly, when I...
4
by: Jon Thackray | last post by:
I'm trying to build some mathml for a paper. I've got the mathml2 dtd, and the style sheets also from the canonical website http://www.w3.org/Math/. But I'm having some trouble. I've input the...
3
by: wende598 | last post by:
I have a Jornada 720 and would like to be able to view MathML files. There is a patch from HP that enables XML on the Pocket IE. Would it be possible to configure it to render MathML? TIA,...
6
by: Zhang Weiwu | last post by:
Hello. I am working with a php software project, in it (www.egroupware.org) Chinese simplified locate is "zh" while Traditional Chinese "tw". I wish to send correct language attribute in http...
1
by: michael_quinlivan | last post by:
Hi I am tearing my hair out trying to figure out how to get MathML to display properly in browsers. None of the tutorials that I have read, including W3C, work at all. Can anyone point me to a...
7
by: David Laub | last post by:
I have stumbled across various Netscape issues, none of which appear to be solvable by tweaking the clientTarget or targetSchema properties. At this point, I'm not even interested in "solving"...
3
by: BakedBean | last post by:
Hi, This is probably really simple, but I've only just been asked to look at this and I've spent a full day trying to get it to work, so any help will be very gratefully received! At present...
0
by: C.W.Holeman II | last post by:
For info on the context of my question see the end of this posting. I have used resource files and xnlLanguage to control the language displayed in a Motif application. Simply dropping an...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.