Useing validator.w3.org

  sheila.weston 22:38 05 Sep 2007
Locked

I am trying to validate a web page and have been looking at the FAQs etc for Validator.w3.org, but can't find an explanation of the error messages ie I have one which says:
Line 31, column 60: XML Parsing Error: Opening and ending tag mismatch: p line 28 and div
!--webbot bot="Include" i-checksum="9392" endspan --> /div>. (The last > is in red and presumably missing from the code.)

Looking at the code page in FP2003, there doesn't appear to be anything wrong with either line 31 or line 28. Does column 60 refer to the number of letters along the line. I am looking on the index page. Or should I be looking in one of the _includes files? Why are TWO line numbers given?

Many thanks for any help.

  Eric10 23:00 05 Sep 2007

If the page is online then a link to it would be invaluable in finding a solution.

  sheila.weston 09:29 06 Sep 2007

Yes, sorry - it is click here

I do really know how to spell 'Using' too!

  brundle 14:37 06 Sep 2007

Am I using the same validator?
click here

It says

# Error Line 31, Column 59: end tag for "p" omitted, but OMITTAG NO was specified.

<!--webbot bot="Include" i-checksum="9392" endspan --></div>

You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".

And yes, Column refers to the character number, drop the source into Notepad2 and it shows character #59 at that point.
Perhaps it's complaining that you have <p> at line 29 then a closing </div> at line 32 before a closing </p> at line 33.

  sheila.weston 16:55 06 Sep 2007

Yes, Brundle, I am using the same w3.org validator, but I have republished some of my pages and the original message has changed and only mentions ONE line number now.

However, I am still mystified. I have ticked in the source and 'clean-up html' boxes. If I go to lines 29 and 31 in the first grey box of code, they both look correct:
<!--webbot bot="Include" i-checksum="9392" endspan --></div>
<!--webbot bot="Include" endspan="" --></p>
becomes:
<p><!--webbot bot="Include" i-checksum="9392" endspan --></p>
</div>
<!--webbot bot="Include" endspan="" -->

ie the first </div> should be </p>
and the second </p> should not be there atall.

Is it safe to just copying the whole of the corrected code (ie the second grey box) without actually bothering about the comments. Then pasting over the existing code in fp2003? It would be a lot easier!!!

  brundle 17:04 06 Sep 2007

Worth a try isn't it. The second example makes sense even to my limited HTML knowledge.

  Eric10 18:04 06 Sep 2007

Your problem at line 69 is <i></i> which is totally unnecessary and is not allowed in that place. It can be safely removed.

Your earlier problem seems to be coming and going so I assume you are working on it at the moment. The cause of it is that you are interleaving your <div> and your <p> tags. If you open a <div> and then open a <p> you need to close the <p> before you close the <div>. The same applies if you open a <p> and then open a <div>, you need to close the <div> before closing the <p>.

You have also intoduced an extra <p> tag as in:
<!--webbot bot="Include" endspan="" --><p></p>
This line should read <p><!--webbot bot="Include" endspan="" --></p> and the earlier <p> stuck out on its own on line 28 should be deleted.

  sheila.weston 20:32 06 Sep 2007

Many thanks, Eric10.

After many tweaks I have got down to 5 errors. There is still something wrong with line 31 and I can't see what.

I see what you mean about the interleaving.

BUT - I tried copying and pasting the html tidy text and it *worked*! Look at index2. All the same I want to get the original index file correct.

Another question - what is wrong with lines 117 and 119? They look OK on my computer, although these lines seem to be on line 81 off-line.

  Eric10 21:12 06 Sep 2007

Delete the <p> on line 28.
Move the </div> from the end of line 31 to the end of line 32. The page will then validate as the later errors are caused by the validator being upset by the earlier error. Once the early error is corrected everything else falls into place.

  sheila.weston 10:41 07 Sep 2007

Oh Dear, here we go again!

The problem is that the code lines on the validator site are different from the corresponding numbers on my computer. Having followed (as I thought) your suggestions and it still had errors, I then reverted to my index2 file which validated OK last time.

But now it has FOUR errors:
XML Parsing Error ?
Line 61, column 7: XML Parsing Error: Opening and ending tag mismatch: div line 22 and body
</body>Line 63, column 8: XML Parsing Error: Opening and ending tag mismatch: body line 19 and html
</html>Line 63, column 8: XML Parsing Error: Premature end of data in tag html line 2
</html>

So............ go to lines 61 and 63 (which is actually 64) and there are </body> and </html> tags, which look OK. But, looking at the corrected version I can see that there should be a </div> just before body, so I go to my computer and THERE IS the </div>, just where it should be.

So what is happening? I republished, just to make sure and had the same result.

This is what is on my fp code-view:
<div id="topmenu">
<!--webbot bot="Include" u-include="_includes/top-menu.htm" tag="BODY" --><!--webbot bot="Include" endspan="" --></p>
</div>
<div id="leftnav">
<!--webbot bot="Include" u-include="_includes/left-menu.htm" tag="BODY" --></div>

</body>

</html>

I *would* like to understand what is happening, but may have to give up and just copy and paste the corrected pages.

  Eric10 14:16 07 Sep 2007

It just a simple error now.
At the end of your code you have:

<!--webbot bot="Include" i-checksum="33447" endspan --></div>
<script type="text/javascript">writeFooterFP();</script>
</body>

The </div> at the end of your webbot line is the closing div for "leftnav" but you are short of a </div> for "container". If you add the missing </div> as:

<!--webbot bot="Include" i-checksum="33447" endspan --></div>
<script type="text/javascript">writeFooterFP();</script>
</div>
</body>

then the page will validate without any errors.

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

Xiaomi Mi Mix 2 review

See mcbess's iconic style animated for Mercedes-Benz

iPhone X news: Release date, price, new features & specs

Black Friday 2017 : date, sites participants & bonnes affaires