Pretty Print/Fix issue

For general web development questions that are not specifically related to CSS HTML Validator. This includes (but is not limited to) general HTML, CSS, Accessibility, JavaScript, and SEO questions.
rag_gupta
Rank II - Novice
Posts: 28
Joined: Tue Nov 30, 2010 10:17 pm

Pretty Print/Fix issue

Post by rag_gupta »

This is sequel to http://www.htmlvalidator.com/CSEForum/v ... f=4&t=1256 which contains some very useful posts and I'd not want to spoil it.

I'm talking about this site page which contains html code corrected by Pretty Print/Fix. I'm talking only about the article code( which starts with Indian Railways Customer Care Numbers) and not code of header, left-right sidebars and the footer.

Earlier many non-mandatory tags in the article (p, li etc) were not closed. And I simply ran Pretty Print/Fix on the old code (as in attachment) to generate a corrected version present in the site page. Mind you that Pretty Fix does not auto close img and br tags.

i've attached the old code of the article(not full page) in the attachment.

I'm not sure of behavior of Pretty Fix, so I've tested my page with w3.org. Please click here to find the errors in this page.

Although I've validated with CSE with flag 180 set as described in http://www.htmlvalidator.com/CSEForum/v ... f=1&t=1255 but I want to know about errors this w3.org is showing( from 3rd error onwards). I want to know the reason behind these errors and not shown by CSE:
Line 266, Column 8: document type does not allow element "h4" here; missing one of "object", "ins", "del", "map", "button" start-tag
<h4><a name="anu555ltg-100004">Options(both Hindi & English) Presented …✉
The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
Line 268, Column 8: document type does not allow element "h5" here; missing one of "object", "ins", "del", "map", "button" start-tag
<h5><a name="anu555ltg-100005">Choose Language</a></h5>✉
The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
Line 269, Column 8: document type does not allow element "ul" here; missing one of "object", "ins", "del", "map", "button" start-tag
<ul>✉
The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
Line 274, Column 8: document type does not allow element "h5" here; missing one of "object", "ins", "del", "map", "button" start-tag
<h5><a name="anu555ltg-100006">Select Option</a></h5>✉
The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
Line 275, Column 8: document type does not allow element "ul" here; missing one of "object", "ins", "del", "map", "button" start-tag
<ul>✉
The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
Line 282, Column 8: document type does not allow element "h3" here; missing one of "object", "ins", "del", "map", "button" start-tag
<h3><a name="anu555ltg-100007">All India City Wise(local) Indian Railways C…✉
The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
You do not have the required permissions to view the files attached to this post.
User avatar
Albert Wiersch
Site Admin
Posts: 3785
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX

Re: Pretty Print/Fix issue

Post by Albert Wiersch »

I'm sorry, there is a lot to "digest" in your message.

Is your main concern about the issues that W3C is finding? Are you wanting to better understand them? And is CSE HTML Validator not finding them? I think this is the case if I understand correctly. If so, then could you provide the exact source of the document that contains the issues and that CSE HTML Validator is not finding? If you can, a small sample document that reproduces the problem would be best.

I do see the errors you quoted, but am am not sure of the source those errors were generated from. I clicked on your "click here" link and the errors were different.

Also, from the errors you quoted, it seems they may be because the document is XHTML strict, which requires proper containers for the elements... that means if you use certain elements, then they must explicitly be contained in an element that allows it. You can't use certain elements without first using an element that can contain it. This is part of the "strict" meaning - you have to get a lot right!

In any case, I would recommend sticking with HTML 4 or even HTML5 as long as you stay limited to the stable & backward compatible parts of HTML5.
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial