Wednesday, March 28, 2012

VWD 2005 gives errors - Frameset DTD XHTML Problem?

Hi,

I have written this code - VWD gives me errors like "frame" or "frameset" not supported.

Is this my faulty code or just VWD making a mistake?

The code:

<%@dotnet.itags.org.PageLanguage="C#"AutoEventWireup="true"CodeFile="index.aspx.cs"Inherits="index" %>

<!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Frameset//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">

<htmlxmlns="http://www.w3.org/1999/xhtml">

<headrunat="server">

<title>Untitled Page</title>

</head>

<noframes>Some bla bla</noframes>

<framesetcols="10,*"border="0"frameborder="0"framespacing="0">

<framename="head"src="head.aspx"scrolling="no"marginwidth="0"marginheight="0"frameborder="0"/>

<framename="main"src="main.aspx"scrolling="auto"marginwidth="0"marginheight="0"frameborder="0"/>

</frameset>

</html>

Thanks, Seb

Hello Seb,

If you're getting validation errors on frameset and frame elements, that's probably because you set the target schema for validation in VWD to one of the languages (like, say, "XHTML 1.0 Transitional") that don't support these elements. Some languages in the target schema dropdown on the Standard toolbar that do support these elements include "Internet Explorer 6.0" and "XHTML 1.0 Frameset".

You may well be asking yourself why there's two XHTML 1.0 options listed in the dropdown. The answer is that there is more than one document type defined in that standard; the one that defines the contents of frameset pages is distinct from the ones that describe non-frameset pages.

HTH,

Clay


Hey Clay,

thanks for your reply. I wonder why I refer to the desired DTD, in my instance the Frameset DTD, in the head of the aspx file. I thought VWD would take the DTD specified in the document and validate the document's contents against this DTD. That was my understanding of a DTD tag in a document.

So are you saying that VWD overrides my specification, my explicit reference to the DTD to be used for validation purposes?

In that case, adding a DTD reference to a document is obsolete?! Which is not the case in my opinion...

Cheerio, Seb!


Hi Seb,

No, VWD's choice of which language to use when validating your frameset is not based on the DTD in the document. However, this doesn't mean that the doctype element in your page is useless. To the contrary, it is very important to the users who will eventually request the page, as that is the way they know which language was used to write the document.

HTH,

Clay


Hello Clay,

okay, that makes sence to me. I found the settings in VWD for the schemata. And I am missing the XHTML 1.0 Strict - only Transitional showing up. Where can I add the 1.0 Strict schema?

I did not find a way of doing that in VWD...

Cheers and thank you for your help!

Seb!


Hi again,

I have re-arragend my code to look like this:

<%@.PageLanguage="C#"AutoEventWireup="true"CodeFile="index.aspx.cs"Inherits="index" %>

<!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Frameset//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">

<htmlxmlns="http://www.w3.org/1999/xhtml">

<headrunat="server">

<title>Untitled Page</title>

</head>

<framesetcols="10,*">

<framename="head"src="head.aspx"scrolling="no"marginwidth="0"marginheight="0"frameborder="0"/>

<framename="main"src="main.aspx"scrolling="auto"marginwidth="0"marginheight="0"frameborder="0"/>

<noframes>Some bla bla</noframes>

</frameset>

</html>

Now, when I look at the DTD on the W3 website, there is a <body> element listed in the frameset DTD. However, for me, as a long time reader of selfhtml.org, there is no body element in a frameset, at least in HTML 4.0 there wasn't any <body> before or after <frameset>.

WHY THEN IS VWD COMPLAINING ABOUT <BODY> BEING USED TO FEW TIMES?! (Error 4 Cannot switch views: Validation (XHTML 1.0 Frameset): Element 'body' occurs too few times.)

Aaaah, I am lost...

Do you know why this happens?

Cheers, Seb


Hello Seb,

To answer each of your questions:

1. VWD doesn't list XHTML 1.0 Strict as a separate validation target mainly because there are remarkably few differences between it and XHTML 1.1 (aside from the new "ruby" element, of course).

2. It's true that the xhtml1-frameset.dtd document inexplicably includes a definition for a "body" element, but a careful review of the DTD shows that that element can never be uned in a valid document in this language. Line 278 in that DTD shows the composition of an html element in that language to be "<!ELEMENT html (head, frameset)>" -- meaning that you cant' acutally next a body inside an html element like you must in other HTML languages. As for the validation error you're reporting, I can't see it when I use XHTML 1.0 Frameset as the target schema for validation. Are you seeing otherwise?

HTH,

Clay


Hi Clay,

okay, I see that point you make under 1.).

As far as the second question is concerned, I uploaded the screenshot for you to see... :-) Reloading or closing down VWD does not do the trick. the error about the missing body is still there.

have a look here:http://home.arcor.de/ripcurl/vwd-frameset-dtd.gif (attach function of this forum does not work - i get a "missing skin" message when the forum tries to load modal dialog for file upload?!)

Cheers, Seb

P.S. the code is exactly the same one as in the above post...


Thanks for the help, Seb.

Actually, closing and re-opening VWD the first time is necessary in order to get the error you describe. I filed a bug report for this, but this is a relatively minor issue in document validation, as there isn't any designer support for framesets in the product anyway (meaning that the only way to edit them is in source view as you've been doing). Consequently, while it is possilbe this could be fixed in a future service pack, you shouldn't presume that this will happen.

HTH,

Clay


Hello Clay,

thanks again, I am happy now that I am writing conform code :-), I don't really worry about the bug in vwd... :-)

Funny, all I wanted to do is to remove scrollbars from my page (by using frames). I did not like the idea of making the scrollbar match the background color - nor did the CSS statement overflow : hidden do the trick...

Thank you for your competent and fast help! Much appreciated!

Servus from Munich,

Seb!


Hi Clay,

Well, while you are at it, there is another "bug":

The <frame> attribute "noresize" has no value, but vwd nags about it :-)

Cheers, Seb

0 comments:

Post a Comment