Discussion:
Invisible times (⁢ and ⁢)
(too old to reply)
DKM
2005-05-19 16:02:54 UTC
Permalink
When I use the invisble times as in <mo>&it;</mo> or
<mo>&invisibletimes;</mo>, it displays as &amp;it; or something like
that FireFox 1.0.3. It displays just fine in IE 6.0 with Mathplayer 2.0
installed. Do I have to include any script file for mozilla based
browsers for these special character entities?

Thanks in advance.

D.K. Mishra
DKM
2005-05-19 19:40:03 UTC
Permalink
Post by DKM
When I use the invisble times as in <mo>&it;</mo> or
<mo>&invisibletimes;</mo>, it displays as &amp;it; or something like
that FireFox 1.0.3. It displays just fine in IE 6.0 with Mathplayer 2.0
installed. Do I have to include any script file for mozilla based
browsers for these special character entities?
Thanks in advance.
D.K. Mishra
For some reason, my first sentence did not come out as a complete
sentence. I meant to say it does not display correctly in FireFox
1.0.3. It displays as a&it;b or a&invisibletimes;b instead of ab.

I visited a couple demo MathML sites mentioned at mozilla.org, they all
look just fine not only with &it; and &invisibletimes' but also with
many other character entities that I became so envious of.

I must be missing some thing.

My xml file header looks like as follows:

<?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">

Thanks in advance.

D.K. Mishra
R***@dessci.com
2005-05-19 21:22:56 UTC
Permalink
Hi.
Post by DKM
For some reason, my first sentence did not come out as a complete
sentence. I meant to say it does not display correctly in FireFox
1.0.3. It displays as a&it;b or a&invisibletimes;b instead of ab.
I suspect this is just a typo in your email, but the entity name is
case sensitive. Try &InvisibleTimes; instead. I think &it; may not
be supported, as it is really just a shorthand alias. Another thing
to try for debugging purposes is to use the numeric equivalent
&#x2062;

--Robert

------------------------------------------------------------------
Dr. Robert Miner ***@dessci.com
Director of New Product Development 651-223-2883
Design Science, Inc. "How Science Communicates" www.dessci.com
------------------------------------------------------------------
DKM
2005-05-19 23:56:03 UTC
Permalink
Post by R***@dessci.com
Hi.
Post by DKM
For some reason, my first sentence did not come out as a complete
sentence. I meant to say it does not display correctly in FireFox
1.0.3. It displays as a&it;b or a&invisibletimes;b instead of ab.
I suspect this is just a typo in your email, but the entity name is
case sensitive. Try &InvisibleTimes; instead. I think &it; may not
be supported, as it is really just a shorthand alias. Another thing
to try for debugging purposes is to use the numeric equivalent
&#x2062;
--Robert
I have &InvisibleTimes; as follows in portion of my code:

// multiplies elements x and y
// x and y could be complex valid document fragments
function imultiply(x,y) {
fragDoc = document.createDocumentFragment();

fragDocument.appendChild(x);
moElement = document.createElement("mo");
moElementText = document.createTextNode("&InvisibleTimes;");
moElement.appendChild(moElementText);
fragDoc.appendChild(moElement);
fragDocument.appendChild(y);

return fragDocument;
}

The above works if I replace &InvisibleTimes; with "+" or "+ or "-" or
any other string.

If x was <mi>a</mi> and y was <mi>b</mi>, calling imultiply(x,y) should
return <mi>a</mi><mo>&InvisibleTimes;</mo><mi>b</mi> and should display
it appropriately, but it returns
<mi>a</mi><mo>&amp;InvisibleTimes;</mo><mi>b</mi> and does not display
appropriately.

I tried replacing with &#x2062; It did not work.

Firefox displays as a&InvisibleTimes;b or a&#x2062;b and in the source
code it displays a&amp;InvisibleTimes; or a&amp;#x2062;b

I am at a loss as to why it is not seeing it as &InvisibleTimes;
instead of &amp;InvisibleTimes;. Maybe thats where the problem lies.

Thank you very much in advance.

D.K. Mishra
Post by R***@dessci.com
------------------------------------------------------------------
Director of New Product Development 651-223-2883
Design Science, Inc. "How Science Communicates" www.dessci.com
------------------------------------------------------------------
David Carlisle
2005-05-20 09:01:57 UTC
Permalink
That's the explanation then!
Post by DKM
moElementText = document.createTextNode("&InvisibleTimes;");
document.createTextNode is part of some programming language, but it
isn't XML and the string "&InvisibleTimes;" will be parsed with the
conventions of the programming language in question in which & is a
special character and the string has length 17 (if I can count:-)
so the dom node will have a string of that length inserted and it will
appear in a linearised XML file as &amp;InvisibleTimes;

Conversely if you have &InvisibleTimes; in an XML file, the entity
referencsed is resolved by the XML parser and a single character is
inserted into the DOM.

There is nothing special about MathML in this, it would be the same if
you did this with &nbsp; in an XHTML document.

David


________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________
DKM
2005-05-20 12:23:25 UTC
Permalink
Post by David Carlisle
That's the explanation then!
Post by DKM
moElementText = document.createTextNode("&InvisibleTimes;");
document.createTextNode is part of some programming language, but it
isn't XML and the string "&InvisibleTimes;" will be parsed with the
conventions of the programming language in question in which & is a
special character and the string has length 17 (if I can count:-)
so the dom node will have a string of that length inserted and it will
appear in a linearised XML file as &amp;InvisibleTimes;
Conversely if you have &InvisibleTimes; in an XML file, the entity
referencsed is resolved by the XML parser and a single character is
inserted into the DOM.
There is nothing special about MathML in this, it would be the same if
you did this with &nbsp; in an XHTML document.
David
I had it working already by passing the string "\u2062" following
Robert's suggestion. I am going to purchase a good book or two on
javascript and xml/html as soon as I can. I am really excited about the
possibilities that can happen with MathML and javascript.

Thank you again.

D.K. Mishra
________________________________________________________________________
Post by David Carlisle
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a
proactive
Post by David Carlisle
http://www.star.net.uk
________________________________________________________________________
DKM
2005-05-20 00:54:06 UTC
Permalink
Post by R***@dessci.com
Hi.
Post by DKM
For some reason, my first sentence did not come out as a complete
sentence. I meant to say it does not display correctly in FireFox
1.0.3. It displays as a&it;b or a&invisibletimes;b instead of ab.
I suspect this is just a typo in your email, but the entity name is
case sensitive. Try &InvisibleTimes; instead. I think &it; may not
be supported, as it is really just a shorthand alias. Another thing
to try for debugging purposes is to use the numeric equivalent
&#x2062;
Thank you. I got it working. Here was the problem:

I had

moElementText = document.createTextNode("&InvisibleTimes;");

that was not working.

I changed it to

moElementText = document.createTextNode("&#x2062;");

that too did not work.

Now, I changed it to

moElementText = document.createTextNode("\u2062");

and it worked.

I suppose you have to say that it is unicode string.

While I have your attention, please know that it was not a problem with
Mathplayer 2.0 for IE 6.0. It did not matter whether I put
"&InvisibleTimes;" or "&it", but it was not interpreting "&#x2062;".
But, it has no problem with "\u2062".

Again, thank you for the right solution.

I notice that you have a Ph.D., if you don't mind, is that in
mathematics?

D.K.Mishra
Post by R***@dessci.com
--Robert
------------------------------------------------------------------
Director of New Product Development 651-223-2883
Design Science, Inc. "How Science Communicates" www.dessci.com
------------------------------------------------------------------
R***@dessci.com
2005-05-22 17:10:50 UTC
Permalink
Hi.
Post by DKM
While I have your attention, please know that it was not a problem with
Mathplayer 2.0 for IE 6.0. It did not matter whether I put
"&InvisibleTimes;" or "&it", but it was not interpreting "&#x2062;".
But, it has no problem with "\u2062".
Again, thank you for the right solution.
I'm glad to have been of help.
Post by DKM
I notice that you have a Ph.D., if you don't mind, is that in
mathematics?
Yes, differential geometry.

--Robert

------------------------------------------------------------------
Dr. Robert Miner ***@dessci.com
Director of New Product Development 651-223-2883
Design Science, Inc. "How Science Communicates" www.dessci.com
------------------------------------------------------------------
Loading...