Sandra Reinhart | 1 Oct 2010 22:11
Picon
Picon

document type does not allow element "div" here?

Hello!

I am the webmaster of http://www.frauenportal.net/ - I am trying to validate my website. I used
http://validator.w3.org/ and am getting some errors.

The only error I do not understand, is the following:

Line 70, Column 20: document type does not allow element "div" here; missing one of "object", "applet",
"map", "iframe", "button", "ins", "del" start-tag

  <div class="logo"></div>

Can somebody please explain me this error?

Thank you!

Sandra
--

-- 
Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief!  
Jetzt De-Mail-Adresse reservieren: http://portal.gmx.net/de/go/demail

kibitz | 1 Oct 2010 08:01
Picon

[VE][64] Question.

Hello, I'm from Argentina (sorry for my english), I'm using the HTML 4.01 Transitional and I've a question:
These "error lines" are written by my hosting server and I can't see them with my html editor or notepad and I can't erase the lines.
I can't correct that, can you give me a solution? Sorry for the beginner's question, the important thing is to learn. 
Thanks for your time. :)




The error lines:


Validating http://www.cinecrack.com.ar/index.html
Error [64]: "document type does not allow element X here"

The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).

One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error).

Jukka K. Korpela | 1 Oct 2010 22:32
Picon
Picon

Re: document type does not allow element "div" here?

Sandra Reinhart wrote:

> Line 70, Column 20: document type does not allow element "div" here;
> missing one of "object", "applet", "map", "iframe", "button", "ins",
> "del" start-tag

You have there:

<div id="header"> <a href="http://www.frauenportal.net">
  <div class="logo"></div>
  <!--end: logo-->
  </a>
      <!--end: ad468x60-->
</div>

This looks pointlessly complicated, but the technical issue is that you have 
nested a <div> element inside an <a> element, which is forbidden in the 
declared syntax.

Fixing this issue by simple modification of HTML markup is probably 
difficult since you are, in effect, using an empty box as a link, apparently 
relying on a background image appearing in that box. A better approach, for 
several reasons, is to use a normal content image, and then you can use 
normal simple and valid markup like

<div id="header">
<a href="http://www.frauenportal.net"><img src="..." alt="..." 
border="0"></a>
</div>

--

-- 
Yucca, http://www.cs.tut.fi/~jkorpela/ 

Picon
Favicon

Re: document type does not allow element "div" here?

Put simply, it is telling you that you can't have
a <DIV> directly inside an <A>.

Philip Taylor
--------
Sandra Reinhart wrote:
> Hello!
>
> I am the webmaster of http://www.frauenportal.net/ - I am trying to validate my website. I used
http://validator.w3.org/ and am getting some errors.
>
> The only error I do not understand, is the following:
>
> Line 70, Column 20: document type does not allow element "div" here; missing one of "object", "applet",
"map", "iframe", "button", "ins", "del" start-tag
>
>    <div class="logo"></div>
>
> Can somebody please explain me this error?
>
> Thank you!
>
> Sandra

Osman Yüksel | 1 Oct 2010 22:26
Favicon
Gravatar

Re: document type does not allow element "div" here?

Hi,
It's not allowed to put a "div" in an "a" due to DTD

You've such a code

<a href="http://www.frauenportal.net">
<div class="logo"></div>
<!--end: logo-->
</a>



2010/10/1 Sandra Reinhart <sandrar82 <at> gmx.de>
Hello!

I am the webmaster of http://www.frauenportal.net/ - I am trying to validate my website. I used http://validator.w3.org/ and am getting some errors.

The only error I do not understand, is the following:

Line 70, Column 20: document type does not allow element "div" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag

 <div class="logo"></div>

Can somebody please explain me this error?

Thank you!

Sandra
--
Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief!
Jetzt De-Mail-Adresse reservieren: http://portal.gmx.net/de/go/demail




--
Osman Yüksel
http://www.yuxel.net
http://www.opera-tr.com

Jukka K. Korpela | 2 Oct 2010 13:56
Picon
Picon

Re: [VE][64] Question.

kibitz wrote:

> These "error lines" are written by my hosting server and I can't see
> them with my html editor or notepad and I can't erase the lines.

You have 2 realistic options and 1 unrealistic option.

The unrealistic option is that you tell your hosting service provider that 
they should inject their code in a manner that does not make the page 
syntactically invalid. The fix might be technically simple, even trivial; 
the tough, or impossible, part is to make someone out there understand the 
issue _and_ take some trouble in actually fixing it.

The realistic options are:
1) get a better hosting service
2) live with the problem; learn to see which error messages relate to such 
issues, and fix what you can fix.

> Validating http://www.cinecrack.com.ar/index.html
[...]
> Line 122, column 78: document type does not allow element "SCRIPT" here

When I run the validator on that page, I get such an error message as 
relating to line 126. This may depend on content variation, as a server may 
vary its response according to the request headers and other factors, 
perhaps sending different content to different browsers, or depending on the 
assumed country of the request, or the customer's shoe size. (I'm not 
kidding; the shoe size might be stored in a cookie.)

But this is less relevant. The point is that the script element, apparently 
added by the hosting server, appears after the html element, i.e. after the 
end tag </html>, where no elements are allowed. Probably the server works 
simplistically and just appends the analytics code to the document, not 
caring about any validity, or even parsing HTML at all.

Well, if the end tags </body> and </html> are from your code, not inserted 
by the server, then you have a simple and realistic 4th option: remove those 
tags. Then the script element will be valid: it will be part of the body 
element, which will be implicitly closed (together with the html element) by 
the end of the document.

In HTML 4.01 (all versions), it is always valid (though _usually_ not 
recommendable) to omit the end tags </body> and </html>.

--

-- 
Yucca, http://www.cs.tut.fi/~jkorpela/ 

Infinite loading time

Hi,

I have been using w3 validator code on my website, but I had very long loading time. I then decided to remove it.
Is there a way to avoid the loading of the code after a certain amount of time?

Thax for your help.

Cordialement,
Le Webmaster de Parierenfrance.com
webmaster <at> parierenfrance.com
http://www.parierenfrance.com

Günter Hansen | 4 Oct 2010 08:10
Picon

[VE][403] Add Subject Here

Hi Mailinggroup,

Validating http://www.udev.info/  
Error [403]: "reference to external entity in attribute value"

<a href="/cgi-bin/cone/cone_wrapper.cgi?TODO=2410&ID=201005MHGZuL">more ....</a>

There is a thing I don’t understand (or maybe I simply didn’t know about it?). Is it forbidden to put a parameter called “ID” into a URL?

The Validator shows this to be invalid, although its within a URL … !? Can this be right?

 

Kind regards,

Günter Hansen

 

Picon
Favicon

Re: [VE][403] Add Subject Here


Günter Hansen wrote:

> Validating http://www.udev.info/ <http://www.udev.info/update/>
> Error [403]: "reference to external entity in attribute value"
>
> <a
> href="/cgi-bin/cone/cone_wrapper.cgi?TODO=2410&ID*=*201005MHGZuL">more
> ....</a>
>
> There is a thing I don’t understand (or maybe I simply didn’t know about
> it?). Is it forbidden to put a parameter called “ID” into a URL?
>
> The Validator shows this to be invalid, although its within a URL … !?
> Can this be right?

I think it's the unescaped ampersand rather than the ID per se.
I'm not sure whether the recommend fix is to escape the ampersand,
as in "/cgi-bin/cone/cone_wrapper.cgi?TODO=2410&amp;ID*=*201005MHGZuL"
or to represent it using % notation.  I am sure that someone more
expert (or more awake) than I will advise, but try the former
in the meantime.

Philip Taylor

David Dorward | 4 Oct 2010 11:29
Picon
Favicon
Gravatar

Re: [VE][403] Add Subject Here

On 4 Oct 2010, at 08:29, Philip Taylor (Webmaster, Ret'd) wrote:
> I think it's the unescaped ampersand rather than the ID per se.

It is.

> I'm not sure whether the recommend fix is to escape the ampersand,
> as in "/cgi-bin/cone/cone_wrapper.cgi?TODO=2410&amp;ID*=*201005MHGZuL"
> or to represent it using % notation.

You would use % notation if you wanted a literal & in the URL (as opposed to a separator between a value and the
next key of the question string).

Since you want a separator, you just need to represent the URL in HTML, so use &amp;

This is described in the explanation of error message that appears under the error in the validator's report.

--

-- 
David Dorward
http://dorward.me.uk


Gmane