Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Window popup in XML?

Reply
Thread Tools

Window popup in XML?

 
 
Randy Poe
Guest
Posts: n/a
 
      09-20-2008
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/mat.../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
 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      09-21-2008
Randy Poe wrote:

> 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.

--

Martin Honnen
http://JavaScript.FAQTs.com/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Initiating a PostBack on a main window from a popup window Jay ASP .Net 8 06-12-2011 10:51 AM
Popup Window Popup Timing =?Utf-8?B?Sm9obiBXYWxrZXI=?= ASP .Net 3 11-04-2005 07:33 PM
New Popup Window from an existing Popup Window Raffi Javascript 4 08-12-2004 01:21 PM
Main > Popup > Popup > Close popup AND new URL in main? Jens Peter Hansen Javascript 7 06-19-2004 08:56 PM
Popup window to raise event in parent window...can it be done??? Earl Teigrob ASP .Net 4 06-04-2004 11:47 PM



Advertisments