Forum Moderators: open

Message Too Old, No Replies

trying to view an xhtml doc

         

dulcieb

5:20 am on Apr 1, 2003 (gmt 0)

10+ Year Member



I am trying to learn xhtml. I have the following doc from javascriptkit and I saved it as example.xhtml but I get an error in IE5.5 and IE6. Can someone tell me what I'm doing wrong?

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title> Strict DTD XHTML Example </title>
</head>
<body>
<p>
Please Choose a Day:
<br /><br />
<select name="day">
<option selected="selected">Monday</option>
<option>Tuesday</option>
<option>Wednesday</option>
</select>
</p>
</body>
</html>

robjones

5:23 am on Apr 1, 2003 (gmt 0)

10+ Year Member



Hi dulcieb,
I think the select tags should be enclosed in a form tag.

robjones

5:31 am on Apr 1, 2003 (gmt 0)

10+ Year Member



Sorry, I answered too soon, I always presumed the select had to be inside the form tag, but checking with the validator at [validator.w3.org...] it validates.
I checked with IE6 and it seems to display fine, what sort of error are you seeing?
<added>I just noticed you had named the file .xhtml, try using .html and it should work fine.</added>

lorax

1:09 pm on Apr 1, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I checked your code and it validates fine and then I tried to view it in IE6 and saw it fine. Do you see anything? Have you tried a refresh or deleting your cache?

dulcieb

10:15 pm on Apr 1, 2003 (gmt 0)

10+ Year Member



This is the message I get when I use the xhtml extension. If I used .html extension it works fine, but what I want to know is shouldn't I be able to save it as an xhtml extension otherwise it's not an xhtml doc. Thanks for your help.

Here's what I get:

The XML page cannot be displayed
Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.

--------------------------------------------------------------------------------

The system cannot locate the resource specified. Error processing resource 'DTD/xhtml1-strict.dtd'. Line 4, Position 25

"DTD/xhtml1-strict.dtd">

robjones

11:46 pm on Apr 1, 2003 (gmt 0)

10+ Year Member



It is an xhtml document even though it has the file extension .html because xhtml is the follow-on version of html 4. I'm not sure how well supported the .xhtml extension is in browsers and it isn't necessary to have a valid xhtml doc.
I'm not an expert on xml, but it looks to me that when you try to view the .xhtml document in IE, it tries to read it as an xml document and throws an error.

lorax

2:34 am on Apr 2, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



>> I get when I use the xhtml extension

Ah...use html. XHTML is a hybrid of XML and HTML but uses the .html or .htm extension. XML on the other hand is a pure markup language and does require a different extension (.xml).

dulcieb

3:29 am on Apr 2, 2003 (gmt 0)

10+ Year Member



Thank you for your information. One other question. Can you make up your own tags in XHTML and if so how? Are there any good examples of how to do this? I have searched the web, but just get HTML 4.01 tutorials which I know already.

Thanks again

lorax

3:56 am on Apr 2, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



>> Can you make up your own tags in XHTML

Nope. That's where the line is drawn. If you need to make up your own tags then you'd be better off looking into XML but that's a whole 'nother can o'worms to dig into. ;)

dulcieb

11:15 pm on Apr 2, 2003 (gmt 0)

10+ Year Member



So what's extensible about it then? I don't get it except it looks like really strictly written HTML 4.01.