Window popup in XML?

Randy Poe

Usenet Archive
Joined
Oct 6, 2003
Messages
3
Reaction score
0
I apologize for the length of this, my first post here, but I have a long story to tell.

I am writing a page with mathematical content, and I have decided for a variety of reasons to use MathML despite its incomplete support in browsers. I am simultaneously trying to learn Macromedia Dreamweaver, XML, CSS, and MathML so I don't know if this may be a newbie question, but I haven't been able to find a solution to it. So far via a combination of books and web searches I've managed to find solutions to most of the things I've wanted to do. But now I'm completely stumped.

Here's the basic sequence of problems and solutions:

1. Dreamweaver is set up to recognize XHTML, but I couldn't seem to embed MathML examples into the XHTML and have them display (Firefox 3.0.1 is my main test platform). Since the example pages at www.w3c.org/Math seemed to be XML, I switched to XML, i.e put the following line at the top of my file (there are other lines, which I'll get to in a minute).

<?xml version="1.0"?>

I believe I also had to include an <?xml-stylesheet> tag and download some XSL files, and also include this <!-- pref:renderer="techexplorer-plugin" pref:renderer="techexplorer" pref:renderer="css" pref:renderer="mathplayer" pref:renderer="mathplayer-dl"
-->

(I think that last snippet came from W3C)

That is, I've done those things, but don't recall if that was the minimal set of actions to make MathML display. At any rate, it now displays correctly in the browser.

2. Dreamweaver is a developer program that has a split screen, showing raw XML code in one window and an attempt to render the appearance in another window. Changing from XHTML to XML broke the split screen. Design Sciences has a page on working with Dreamweaver and MathML at http://www.dessci.com/en/support/mathtype/tutorials/mathml/mathmldw8.htm

Split screen still didn't work, i.e. Dreamweaver didn't recognize the html, until I added a DOCTYPE tag and also renamed it to have an *.xht extension.

That was sufficient to make split screen work again, though the <math> tags are not recognized and math content does not appear correctly. Fine, I can live with that.

3. I started to realize pretty quickly that I was going to want to use CSS. It took me a while to figure out that I get only one <?xml-stylesheet> per document, and that I use @import to combine them. But I did that. I wasn't sure I could define a CSS file and import XSL (MathML comes with an XSL), but nothing seemed to complain when I did that.

So now my web page starts this way:
<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="leverrier.css"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <!-- pref:renderer="techexplorer-plugin" pref:renderer="techexplorer" pref:renderer="css" pref:renderer="mathplayer" pref:renderer="mathplayer-dl"
-->
<head>

and my CSS file starts this way:
@import url(pmathml.xsl);
@import url(/Accessible_Design.css);

body {
color: #0000ff;
background-color: #DDDDDD;
}, etc.

All seems good.

4. Now I wanted some active content. My original HTML version of this page had popups that were implemented this way:

<a href="#"
onClick="popup('images/lev58_4a.png', 'original');return false;"> Original </a>

This doesn't work in XML. I did some reading, and found that (a) popping up new windows is frowned on now in polite society, and (b) the hover trick using CSS to popup content when the mouse is over some region of the page.

OK, fine. I implemented the hover trick. It works beautifully in my XML page.

But I'm beginning to think that I still want "click-to-show/click-to- dismiss" functionality. Ideally, I'd even want a checkbox that showed all hidden content with a single click. The main driver for this is that I'd like to be able to have the option of printing with the hidden content all showing.

And that brings me to...

5. Does Javascript run in XML pages? Or is there some other way to dynamically change the class of an object on an XML page so that a different CSS rule takes effect?

6. I'm also confused about the role of XSL. As I understand it, XSL transforms a page at browser access time. I could theoretically write rules so that the browser receives HTML instead of XML. Then I could do all the Javascript I want. But then my MathML would break, wouldn't it? That seems to want to be part of an XML page.

There's more, but that's enough for one post. Thanks for any insight anyone can provide.

Randy
 

Martin Honnen

Usenet Archive
Joined
Apr 8, 2000
Messages
6,174
Reaction score
0
Randy said:
5. Does Javascript run in XML pages?

It depends on the browser. With Mozilla or Opera you can certainly use the XHTML script element in XML or XHTML documents to use script.
6. I'm also confused about the role of XSL. As I understand it, XSL transforms a page at browser access time. I could theoretically write rules so that the browser receives HTML instead of XML. Then I could do all the Javascript I want. But then my MathML would break, wouldn't it? That seems to want to be part of an XML page.

I don't use MathML but I believe in the case of MathML the XSLT stylesheet is used to cater for both Mozilla and IE. Mozilla should be able to deal with your XML/MathML document just fine but with IE the XSLT stylesheet is necessary to ensure IE renders any HTML and a plugin renders the MathML.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
548,049
Messages
3,104,244
Members
248,133
Latest member
DujonT

Latest Threads

Top