Due to the limited benefit of Google's AdSearch in my case, I have since removed the code. I will keep this page here, though, in case anyone finds it useful.
Okay, I think it's a fair question why someone would ask why some of these pages don't classify as XHTML Strict and yet I have the XHTML Strict logo at the bottom. Well, in my defence, the problem only occurs on the home page, and the gallery page: the only pages with Google's SiteSearch for AdSense.
I have gone to great lengths to ensure that this website now uses XHTML Strict and CSS throughout.
In the code I have written for this website, with only one exception being in the code generated by my PHP script for the Fretboard Navigator (it has a font tag, and table, and some formatting), there are no instances of:
There are several good reasons for this, including, but not limited to, accessibility, speed (download and execution), and portability (both of browser visibility and flexibility for alternative designs, without touching the original XHTML code).
The only other exceptions to these is in AdSense.
It has taken a great deal of effort to get this site to work without tables, and it works fine in Internet Explorer 6 and FireFox 1.0 (haven't been able to try other browsers at this point though). Realistically, I guess most people wouldn't know the difference browsing to this website, whether it's got tables or not, so largely the effort will go unrecognised. That's fine, but from a web-developer's point of view, I know I've made the right decision as HTML will slowly become out-dated. JavaScript, while it's often an invaluable tool, is also generally taken for granted. I also find that working with JavaScript, most things are working against standards, and are "hacks", as opposed to sticking strictly to the rules, which the most commonly used browsers should also be doing.
I personally blame Frontpage, DreamWeaver and Internet Explorer for poor general coding standards.
Don't get me wrong, I do like DreamWeaver, and still use it (check the source!), but it's easy to let it do all of the work, and I don't think it always can make the right decision. Code re-writing can be a real pain too (if you have it enabled), especially when incorporating affiliate code.
Internet Explorer still has problems with some basic CSS2 (for example, like margin-left:auto and margin-right:auto for centering a layer; no :hover support for tags other than <a>, and the lack of adequate PNG alpha transparency support).
It may have changed since I last used it, but rule of thumb, don't use FrontPage! FrontPage 98 had a particularly infamous bug, which could result in users deleting the entire content of their hard-drive.
I've recently bought TopStyle Pro, and would heartily recommend it. It's the best thing that I've bought for web development.
Anyway, a bit of digression. Back to AdSense and XHTML!
Firstly, there is a strange one. The <input> and <img> tags aren't closed with the standard <img src="..." alt="..." />, but with <img src="..." alt="..."></img> this is really incorrect, because the img and input tags aren't container tags (there should be nothing within them). This doesn't throw up a Strict error, though, because at least the tags are closed.
So, I can technically see why Google's SiteSearch code fails, but I don't know of any reason why they couldn't have used inline CSS to remedy all of these problems, and why they used </img> and </input> at all is beyond me.
Yes, they have, and some sites claim to have had responses from Google that allow them to encapsulate the SiteSearch code inside an <object>, refering to the offending HTML in a separate page. This would indeed enable the page to work, and even with relevant adverts still showing, while validating correctly.
I got the following feedback from Google support:
Thank you for your message. Unfortunately, the arrangement you described
would not be permissible by our program policies. In addition, with this
arrangement Google ads would not be targeted to the specific page as the
actual ad code is in an other HTML page and referred to from the actual
XHTML page.
We appreciate your taking the time to offer us this feedback and encourage
you to continue to let us know how we can improve Google AdSense. For
additional questions, please visit our AdSense Support site at
https://www.google.com/support/adsense or feel free to reply to this
email.
I replied with:
"I have since read that one possible work-around is to link to the AdSense code within an <object>, tag as a separate (HTML) page: http://keystonewebsites.com/articles/adsense.php
I found the link to that page here:
[http://www.workingwith.me.uk/blog/13872/]"
and got the following reply:
Thank you for your email. As previously noted, unfortunately, we are unable to provide support for XHTML at this time. We are currently only able to provide the AdSense ad code and the AdSense search code in HTML form as located in your AdSense account and are unable to recommend means of code implementation onto your pages aside from directly placing it onto the source of your pages. We appreciate your understanding.
Fairly standard replies, and although they seem keen to improve the AdSense service, it looks to me that XHTML compliance is not high on their list of priorities.
I think this is a shame, because I think XHTML will take websites into the next generation of design. I've had a look at XHTML 2, and the new standards, and there are some really smart changes (just a couple of good ones, as I see it, listed here):
It's still early days for XHTML 2.0 (spring 2005), and I think it's still being drafted, and support is only started to be written into browsers, so it will be quite some time before it can be used generally. However, I've been waiting a long time to be able to use CSS to this extent. It's been worth the wait.
Anyway, back to my XHTML and AdSense dilemma. I think I'll keep the AdSense search facility for a while, and see how it goes. At this point in time it doesn't seem to be particularly useful, but time will tell. I will keep my pages XHTML Strict upto the point that I have 100% control over them, and only Google's SiteSearch is falling short.
Maybe sometime, they will address this... Maybe...