Attempt to validate a default Blogger template (I)

html/xhtml editing
Image by pitel

Because the previous post regarding validation had somewhat of a success, I decided to do another one. This time I decided to try to validate a default Blogger template and I will also try to be more exact in the steps you need to take. Please note that the solutions I provide might not be the best or they might not be suited for your own template. In several occasions I remove elements I personally do not use, but you might find useful. However the general pointers I give should apply across the entire Blogger platform.

For now, I will deal with the default Minima template. The reason I chose this one is that I consider it to be a very clean one (from a visual point of view), that many people choose for their blogs. And on top of that, it's the one Blogger selects by default when you create a new blog. That being said, let's begin.

Template: Minima
Front page, two test posts
Gadgets: Archive, Profile, Labels
Encoding: utf-8
Doctype: XHTML 1.0 Strict
Initial errors: 339 errors, 73 warnings

Leaving the template HTML unchanged, we do an initial validation check. This is to see the things we need to fix, obviously. So here we are, a list of the main errors, somewhat grouped:

  1. "Missing xmlns attribute for element html. The value should be: http://www.w3.org/1999/xhtml"
  2. Warnings: multiple comments in comment declaration
  3. There is no attribute "name". There is no attribute "description". There is no attribute "type". There is no attribute "default".
  4. Element "Variable" undefined. End tag for "Variable" omitted, but OMITTAG NO was specified
  5. General entity "zx" not defined and no default entity. Reference to entity "zx" for which no system identifier could be generated.
  6. There is no attribute "src" (<iframe src="http://www.blogger.com/navbar.g?targetBlogID=xxx" ... >). There is no attribute "marginwidth". There is no attribute "marginheight". There is no attribute "scrolling". There is no attribute "frameborder". There is no attribute "height". There is no attribute "width". There is no attribute "id". There is no attribute "title". ... element "iframe" undefined.
  7. general entity "postID" not defined and no default entity. reference to entity "postID" for which no system identifier could be generated.
  8. "Required attribute 'alt' not specified" and "End tag for 'img' omitted, but OMITTAG NO was specified"
  9. "There is no attribute 'target'"
  10. several "General entity not defined" caused by de quick edit buttons that you see when you are logged in to Blogger
  11. more "General entity not defined" caused by the archive toggle link
  12. many "XML Parsing Error: Comment not terminated."
  13. many "XML Parsing Error: EntityRef: expecting ';'"
  14. a few "Opening end ending tag mismatch".

 

validation editing
Image by svanes

So now let's start with fixing stuff. I started from the top rather that analyzing what are the major errors and fixing those first. The reason for this is that it's easier for me to follow. You can use whichever order you like. Another way I recommend to start is with the Doctype declaration. Analyze the page, see in which Doctype it fits (or in which one you would like to fit) and change things accordingly.

1. The error is pretty self explaining. When I checked the HTML code, there were already several xmlns declarations, but none of them appeared in the source sode of the page when viewed in browser. So I removed all of them and replaced them with xmlns="http://www.w3.org/1999/xhtml". After saving the template the deleted attributes reappeared. I guess they're needed for something.
Remaining 338 Errors and 73 Warnings.

2. There were two lines of dashes (-) before and after the copyright notice in the template. Although these were commented out, they still caused errors. So I removed them.
Remaining 256 Errors and 73 Warnings.

In the skin section there were more dashed lines under the different sections described by the CSS (header, sidebar, comments, ...) used to separate and organize them. Although only the header section style comments created errors, I removed all the lines just to be sure
Remaining 79 Errors and 62 Warnings.

3. Errors disappeared because of previous modifications

4. Errors disappeared because of previous modifications

Continue to part 2 of this post: Attempt to validate a default Blogger template (II)

3 comments:

f4dLy said...

thank you for writing this tip. I had a little trouble for valid html. (8 errors, 2 Warning), I need help

M.Pinto @ ProHacker said...

Good one.. Thanks. :)

www.ProHacker.IN

Osho @ Latest Tips And Tricks said...

Thanks But I Validate Template Because I Come To Know About This From Mr.Pinto' Blog


Tricks.OshoGarg.com

Post a Comment