Forum Moderators: open
You can use either:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
or
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
W3C References:
Valid DTDs [w3.org]
Frames in HTML Documents [w3.org]
My fix was to use an <object> element in place of the iframe thusly:
<object data="YourURI.here" type="text/html" height="100%" width="100%"></object>
HTH
I always wonder when I see requests for making things validate in a strict doctype which validate already with a transitional one.
Using a transitional doctype is not a badge of shame, nor an admission of failure: it's simply a case of using the right tool for the job. It's certainly far better than hacks using Javascript or object tags.
I guess I didn't make myself very clear; I'm not concerned with getting a page with an <iframe> to validate.
I am wondering why an <iframe> (or a regular frame) doesn't conform to the Strict standards. Are frames not recommended? Is there a substitute?
It's similar to using some deprecated tags that won't validate in Strict, in that situation you can either use Transitional or use a different method and/or styles; I prefer the later.
I've always wondered why frames fall into that category. Let's say you have a perfect XHTML Strict page and need to add just one <iframe>, it's no longer Strict, so frames must not be recommended.
I'm far more concerned with why they aren't Strict (thus supposedly not proper) than finding a way to have them validate.
Take care,
Emperor
I came to the conclusion long ago that the people in charge of setting internet standards are really not as bright as they would have us believe. Why, for instance, is there still no method of implementing proper client-side includes for text? Images can be easily shared between pages but, for no apparent reason, text/html cannot. This could have been implemented simply by adding a SRC attribute to the <DIV> tag.
Kaled.
In Strict, I think that the TARGET attribute for links has also gone.I came to the conclusion long ago that the people in charge of setting internet standards are really not as bright as they would have us believe. Why, for instance, is there still no method of implementing proper client-side includes for text? Images can be easily shared between pages but, for no apparent reason, text/html cannot. This could have been implemented simply by adding a SRC attribute to the <DIV> tag.
Kaled.
Yes, the target attribute was deprecated in XHTML 1.0 Strict. It continued into XHTML 1.1, but it is coming back hopefully. Check out the XHTML Hypertext Attributes Module, a part of the XHTML 2.0 Working Draft:
[w3.org...]
<!-- EDIT -->
As for the <iframe> problem, it isn't recommended because they are similar to frames. Frames caused a lot of problems, so they removed them from the Strict DTDs.
XFrames (which are supposed to be better) are mentioned in the above page, but there is nothing about how to use them in an XHTML document.
I have a page that has iframes, and I just checked now and it validates perfectly ok. Here's my DTD usage:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
In the source listing I have:
89: <iframe src="http:// etc
and the W3C validator says "This Page Is Valid -//W3C//DTD XHTML 1.0 strict//EN!"
If using iframes is not valid markup, why don't I get errors like other people do... not that I want errors, mind you :) but this is just something that confuses me. In this example, is iframe valid for the DTD, and if not what might be the reason for the validator giving different results. Or am I being totally dizzy here...? Thanks.
[edit]aha, strict <> Strict? perhaps - but why does strict still find other errors, hmmm, changing to Strict seems to give some errors that strict (lower case) does not although this certainly explains why I only get half the errors others seem to do[/edit]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 [b]S[/b]trict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">. If you try with the WDG validator rather than the W3C one, the error will show up more clearly. You need to fix this error, because if you don't you can't rely either on your validation results, nor on your browser rendering mode.
The trouble with
<object> is it's tricky cross-browser implementation. An <iframe> is so much more reliable. However, it suffers from the same accessibility problems that standard frames have, and it is best avoided unless you have no alternative. XFrames and XHTML 2.0 are no more than pipe-dreams at the moment, so are not articularly relevant until the specs are released and browser support is forthcoming - in, say, about 10 years time.