Help - Search - Members - Calendar
Full Version: html validation problems. Will pay.
HTMLHelp Forums > General Interest > Jobs Seeking Programmers
Cary
When validating, I get this response many times:
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).
----------------------------
Example of a line that got the above response:
Line 185, Column 76: document type does not allow element "A" here
… in Canaan from <a href="Lv.html#mblb">1500</a>, <b>Late Bronze-2</b> from <a …
----------------------------
I will undoubtedly have more validation problems.
pandy
If you post the link to a sample document or paste the markup in your post we will help you. For free. The short snip above isn't enough since it doesn't show the context for the A.

I would also like to know what tool that gave you that error message. It's more verbose than the output from the validators I know of.
Cary
[quote name='pandy' date='Feb 23 2020, 09:23 PM' post='138424']

pandy, Thank you for responding. That particular page is not on my site yet, because I want to get it validated before uploading it (along with about 60 similar pages).
Here is a sample of the type of page I'm currently trying to validate: https://www.sanityquest.com/time/5c-3c/Ital.html
This "World Chronology" section of my site covers 2000BCE to 100BCE. The 60 or so pages that remain to be uploaded are for 100BCE to 0BCE.

The tool that gave me the response is:
http://validator.w3.org/
pandy
Peculiar. I've never seen that kind of output from the w3c validator.

The page you linked to generates some errors, but none of them close to the error you originally asked about.
Cary
Right. I said That particular page is not on my site yet.
Do I need to have it on my site in order to continue?
Can I upload it here? It's 97.4k.

I can also upload a smaller version of that page which has the errors I'm talking about.
rachel14.g
Hi @cary

Thanks for sharing the problem here.

I am having expertise in same domain and can surely help you out.

Please share details on rachel at cisinlabs dot com

or can discuss more on skype - live:.cid.52caceaa56239236


Looking forward.

Rachel
Christian J
QUOTE(Cary @ Feb 25 2020, 07:22 AM) *

I can also upload a smaller version of that page which has the errors I'm talking about.

That's the best approach.

You can either upload files (just make sure to embed the file into the forum post after uploading) or paste the code example directly into a post.

Cary

Thank you Christian. Here is my attempt to do that.
This 4.22k doc called "Carys validation prob" has 8 errors of 3 types, none of which I understand. It is a knocked down version of a page from my World Chronology section:
http://www.sanityquestpublishing.com/time/tindex.html
pandy
Uhm, no it does not. biggrin.gif

Congratulations
The document located at <http://www.sanityquestpublishing.com/time/tindex.html> was successfully checked as HTML 4.01 Transitional.


https://validator.w3.org/check?uri=http%3A%...ine&group=0
pandy
Aha. The attached file is the one with the 8 errors. I assumed they were the same. Let's see.
pandy
Since you use HTML 4.01 I use the validator on this site. Its output is a little easier to understand.

https://htmlhelp.com/cgi-bin/validate.cgi?a...s&input=yes


CODE
Line 84, character 47:

... %" border="1" cellpadding="5">
                                 ^

Error: element TABLE not allowed here; possible cause is an inline element containing a block-level element



That's here.
CODE
<a name="act">
<table width="100%" border="1" cellpadding="5">
<tr>
    <td width="50px" rowspan="2">c.1200</td>
    <td>ACCO, <span class="egl">under Egypt from <a href="Lv.html#ace">1900</a></span>, comes under TYRE until <a href="../1k-500/Lv.html#aci">1000</a>.</td>
</tr>
</table>


You have opened an A element that you never close. That makes the table be contained in A and that cannot be. You seem to want that A for a named anchor. You don't need the A at all. You can give any element an id and link to that. You can give TABLE or the first TD id="act" and it will work the same. The <a name="act"> should be removed.


Then you have a bunch of these...
CODE

Error: element A not allowed here; check which elements this element may be contained within


and a couple of these.
CODE
Error: element P not allowed here; possible cause is an inline element containing a block-level element


They will all magically go away when you correct the first error. biggrin.gif

That unclosed A tag makes everything after it be contained in the A you have opened. And A can't contain anything but inline elements except A. So no A, no P and no TABLE and so on.

Not as bad as you thought, huh? happy.gif

It's useful to understand this container stuff. And what elements can contain what other elements. Because HTML is all about containers. And that's how validators speak.
Christian J
QUOTE(pandy @ Feb 26 2020, 05:58 AM) *

And A can't contain anything but inline elements except A. So no A, no P and no TABLE and so on.

As a sidenote I'll just add that this applies to HTML4 only. HTML5 does allow you put block elements and TABLE inside A (but you can never nest A elements, so such a table could not contain any A elements in its cells).
pandy
No, it applies to all versions of (X)HTML except HTML 5. tongue.gif
Cary
[quote name='pandy' date='Feb 25 2020, 11:58 PM' post='138436']
Since you use HTML 4.01 I use the validator on this site. Its output is a little easier to understand.

OOOOOOOOOOOOOOOOKay
THANK YOU!

Now I feel stupid, but it was worth it.
Where's the donation page?

Cary
pandy
Nah, you aren't stupid. You validate and that's very smart. wink.gif
Christian J
QUOTE(pandy @ Feb 27 2020, 01:19 AM) *

No, it applies to all versions of (X)HTML except HTML 5. tongue.gif

True, I should've written "versions before HTML5". smile.gif
pandy
laugh.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2020 Invision Power Services, Inc.