Forum Moderators: open

Message Too Old, No Replies

strict vs. transitional and google adsense validating

Does Google adsense code validate as xhtml strict?

         

4thePegeh

7:34 am on May 21, 2007 (gmt 0)

10+ Year Member



The following at the top of my document makes my google adsense code not validate at w3c.

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

When I begin my document with the following code it validates:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

I doubt google would provide code that does not validate, so I suspect I have done something wrong. If you agree that my assumption is reasonable, I will try to figure out what that is.

Marcia

7:37 am on May 21, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



>I doubt google would provide code that does not validate,

Sure they would. Would it even be possible to provide code that would validate for both HTML strict and XHTML strict?

4thePegeh

8:31 pm on May 21, 2007 (gmt 0)

10+ Year Member



Yes. It appears you are right and they would. I just tried my document as XHTML 1.0 Strict twice with the only change being whether or not it called the google code. It validated when it did not call it and did not validate when it did.

So, I guess, if I want to use the adsense, I just switch to XHTML 1.0 Transitional.

Fotiman

8:38 pm on May 21, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Or better yet, switch to HTML 4.01. See Why most of us should NOT use XHTML [webmasterworld.com].

4thePegeh

9:33 pm on May 22, 2007 (gmt 0)

10+ Year Member



Bummer.

Back to 4.01 I guess.

Marcia

9:44 pm on May 22, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Aren't most all WordPress sites XHMTL? They don't seem to be having problems getting indexed or viewed.

encyclo

2:14 am on May 23, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What exactly are you validating? The AdSense code itself (the two Javascript sections) should validate XHTML 1.0 Strict, but the generated markup from those scripts includes an
iframe
, which won't.

The "error" is inconsequential, so just ignore it (of use Transitional if you really can't face having the error).

Nothing related to the doctype will have any effect on indexing.