The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> html validation problems. Will pay.
Cary
post Feb 23 2020, 09:20 PM
Post #1





Group: Members
Posts: 5
Joined: 20-September 19
Member No.: 26,995



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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Feb 23 2020, 09:23 PM
Post #2


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 18,874
Joined: 9-August 06
Member No.: 6



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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Cary
post Feb 24 2020, 08:08 PM
Post #3





Group: Members
Posts: 5
Joined: 20-September 19
Member No.: 26,995



[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/

This post has been edited by Cary: Feb 24 2020, 08:13 PM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Feb 24 2020, 09:09 PM
Post #4


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 18,874
Joined: 9-August 06
Member No.: 6



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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Cary
post Feb 25 2020, 01:22 AM
Post #5





Group: Members
Posts: 5
Joined: 20-September 19
Member No.: 26,995



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.

This post has been edited by Cary: Feb 25 2020, 01:30 AM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
rachel14.g
post Feb 25 2020, 02:41 AM
Post #6





Group: Members
Posts: 5
Joined: 17-December 19
Member No.: 27,081



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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Feb 25 2020, 09:21 AM
Post #7


.
********

Group: WDG Moderators
Posts: 8,458
Joined: 10-August 06
Member No.: 7



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.

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Cary
post Feb 25 2020, 10:34 PM
Post #8





Group: Members
Posts: 5
Joined: 20-September 19
Member No.: 26,995




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

This post has been edited by Cary: Feb 25 2020, 10:39 PM


Attached File(s)
Attached File  Carys_validation_prob.html ( 4.23k ) Number of downloads: 31
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Feb 25 2020, 11:30 PM
Post #9


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 18,874
Joined: 9-August 06
Member No.: 6



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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Feb 25 2020, 11:37 PM
Post #10


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 18,874
Joined: 9-August 06
Member No.: 6



Aha. The attached file is the one with the 8 errors. I assumed they were the same. Let's see.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Feb 25 2020, 11:58 PM
Post #11


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 18,874
Joined: 9-August 06
Member No.: 6



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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Feb 26 2020, 06:47 PM
Post #12


.
********

Group: WDG Moderators
Posts: 8,458
Joined: 10-August 06
Member No.: 7



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).
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Feb 26 2020, 07:19 PM
Post #13


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 18,874
Joined: 9-August 06
Member No.: 6



No, it applies to all versions of (X)HTML except HTML 5. tongue.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Cary
post Feb 26 2020, 10:42 PM
Post #14





Group: Members
Posts: 5
Joined: 20-September 19
Member No.: 26,995



[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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Feb 26 2020, 11:11 PM
Post #15


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 18,874
Joined: 9-August 06
Member No.: 6



Nah, you aren't stupid. You validate and that's very smart. wink.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Feb 27 2020, 07:20 AM
Post #16


.
********

Group: WDG Moderators
Posts: 8,458
Joined: 10-August 06
Member No.: 7



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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Feb 27 2020, 09:51 AM
Post #17


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 18,874
Joined: 9-August 06
Member No.: 6



laugh.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 2nd July 2020 - 07:17 AM