Peter via Dng said on 04 Jan 2025 09:32:28 -0700
>From: Steve Litt <slitt@???>
>Date: Fri, 3 Jan 2025 04:28:55 -0500
>> See also https://troubleshooters.com/web/validating.htm#xmlchecker
>
>Thanks twice.
>
>I've used the W3C validator for years, oblivious to the possibility of
>local installation. So now it's installed. Thanks1!
>
>The file at https://easthope.ca/Peter.html validates with no error.
>Your section "End Tag Rules of the Road" is perfectly sensible
>although the validator notes trailing slashes, <br/> and etc.
>
>xmlchecker.py is also installed. Brilliant! Thanks2!
>It gives this output.
>
>Testing for well formedness Peter.html ...
>
>ERROR: mismatched tag: line 20, column 2 !!!!!!
>
>=======================================
>Disclaimer: This program replaced file Peter.html's
><!DOCTYPE > line with a special html5
>DOCTYPE line while evaluating. The original
>file has not been changed. It's possible
>this program might be inaccurate if the
>original file had a non-html5 DOCTYPE line.
>=======================================
>
>The error at 20.2. baffles me.
>
>To my knowledge <!DOCTYPE html> is correct for HTML5. The disclaimer
>is for unidentified syntaxes?
>
>A linguistic question for possible interest. In my understanding,
>validity of HTML is syntactic correctness of HTML. And
>well-formedness of XML is syntactic correctness of XML. Validity and
>well-formedness are just two synonyms for syntactic correctness.
>Correct? More subtle?
The w3c validator checks for valid HTML5 and doesn't care a bit about
XML well-formedness or not. My xmlchecker.py checks for well formed XML
and doesn't care a bit about html5 validity. So in your case, it said
that according to the syntax rules of well formed XML (having nothing
to do with HTML), your line 20 </head> was a mismatched tag. The root
cause turned out to be that your line 4, <meta charset="utf-8">, had no
trailing slash or end tag, so xmlchecker.py wanted to see a </meta>
before the </head>.
With this solved, xmlchecker.py errored out on a mismatched tag on line
62, the </div> right after "All rights reserved".
There's another place where you forget a trailing slash, and putting
that in moves the error all the way down to the high 300's.
I removed all your comment-outs. Commenting out doesn't work well in
HTML, and often gives misleading messages. Better to remove the whole
commented thing into a file, and put tiny text comments above and below
where that file's text was. I didn't bother: It looked like except for
the Wikipedia months the comments were things you'd never use again.
REPEATING: Commenting out is a very bad diagnostic tactic in HTML, and
often creates problems where there would otherwise be none.
Your links section is a mess, and somewhere in that mess is an XML
syntax error. I proved this by temporarily removing all the links
content, after which xmlchecker.py gave the CONGRATULATIONS message. I
leave it as an exercise to you to figure out where the XML syntax error
is within the links.
I have some general suggestions for you. The first one is this: Put
plenty of breathing room in your file. Blank lines make convenient
places to place a starting <div> tag or an ending </div> tag for
troubleshooting. Blank lines, especially if placed strategically, make
your intent clear and make it easier to see problems.
You have a lot of </p><p> pairs. I recommend a paragraph start with <p>
at the beginning of its first line, end with </p> at the end of its
final line, and follow each paragraph with a blank line. This makes it
much easier for you or others to map your intent to the DOM model.
Last but not least, once you get this thing both HTML validated and XML
syntaxed, run those two tests often. Your current situation is crazy
difficult, but if, every 10 minutes to 1/2 hour you run xmlchecker.py,
mistakes will be trivial to spot and fix.
HTH,
SteveT
Steve Litt
http://444domains.com