View Full Version : xml,ie and mozilla

01-30-2003, 04:38 PM
I'm confused. I've seen sits that use xml and I've been able to see them in IE5. I thought I'd have a bash at xml, so I did this:

<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="author" content="Nightfire" />
<meta name="description" content="Site on motorcycles" />
<meta name="keywords" content="motocycles" />



<p>Welcome to me new site!</p>

<hr />
<p><small>Created on ... January 29, 2003</small></p>

Works fine in Mozilla, shows how I want it, but when I try to see it in IE5, it just shows the source with (+)(-) in various places.

So how do I get it to show in IE5 as a proper page? :confused:

01-30-2003, 04:51 PM
What you've posted there is XHTML - XHTML is XML, but not in the sense you're thinking of - it already has a predefined DTD, and browsers laready know how to parse it into visual output. You're seeing the node tree because you;ve used the ".xml" extension for the file.

If you change the file extension to .html, you'll be able to see the page. But I'm guessing that's not what you want - I think what you want is XML which you can transform into XHTML ... for which you also need an XSL stylesheet.

w3schools have excellent tutorials on getting started with XML/DTD/XSL

01-30-2003, 05:16 PM
tbh I wasn't sure what it was that I did up there. It was done by using notetab and I saw xml at the top of the page so assumed it was xml :confused:

Gonna read up at the tutorial site now to see if it can unconfuse me :) :thumbsup:

01-30-2003, 05:23 PM
What you are seeing is IE being stupid. IE does not recognize the XHTML namespace - rather it invokes its HTML rendered when it is presented something with it knows to be HTML - either a known extension (.html, .htm), or something served as text/html.

The proper behavior is to invoke the XHTML rendering, like Mozilla does.

As a matter of fact, serving XHTML 1.1 as text/html (tagsoup) is invalid, and highly discouraged with XHTML 1.0. But of course, IE makes this impossible without content negotiation for good browsers, and for IE.