Forum Moderators: open

Message Too Old, No Replies

Google CSE won't validate

Any suggestions?

         

jwgrafflin

11:04 am on Mar 13, 2008 (gmt 0)

10+ Year Member



W3C validation returns the following errors for Google CSE code:

document type does not allow element "form" here; missing one of "object", "ins", "del", "map" start-tag.

…ox_015681913527632997726:9bvz-ifkdm8">

document type does not allow element "input" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag.

…="015681913527632997726:9bvz-ifkdm8" />

document type does not allow element "input" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag.

<input type="hidden" name="cof" value="FORID:11" />

document type does not allow element "input" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag.

<input type="text" name="q" size="25" />

document type does not allow element "input" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag.

<input type="submit" name="sa" value="Search" />

jwgrafflin

11:18 am on Mar 13, 2008 (gmt 0)

10+ Year Member



Missed this one for the last line of the CSE code:

XML Parsing Error: EntityRef: expecting ';'.

…://www.google.com/coop/cse/brand?form=searchbox_015681913527632997726%3A9bvz-…

netmeg

1:48 pm on Mar 13, 2008 (gmt 0)

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



AdSense for Search doesn't validate either. I've emailed support numerous times, never gotten a single response back. As far as AdSense for Search, we're stuck with it because we can't modify the code, even to the one single movement of a slash that would make the code validate. CSE - I dunno, I think you can modify that code, but I don't know for sure.

jwgrafflin

5:48 am on Mar 14, 2008 (gmt 0)

10+ Year Member



Found the solution to all but the last line. Enclose the input fields with <fieldset>, like this:

<form>
<fieldset>
<input>
<input>
</fieldset>
</form>

Still can't figure out the last line:

Line 199, Column 131: reference not terminated by REFC delimiter.
…681913527632997726%3A9bvz-ifkdm8&lang=en"></script>&#9993;
If you meant to include an entity that starts with "&", then you should terminate it with ";". Another reason for this error message is that you inadvertently created an entity by failing to escape an "&" character just before this text.

Line 199, Column > 80: XML Parsing Error: EntityRef: expecting ';'.
…://www.google.com/coop/cse/brand?form=searchbox_015681913527632997726%3A9bvz-…

OutdoorWebcams

7:36 am on Mar 14, 2008 (gmt 0)

10+ Year Member



No offence in mind, but why bother?

Validation of a Google SERP returns more than 300 errors but is successfully accessed and used by billions...

(And welcome to WebmasterWorld, jwgrafflin! :-))

-fixed typo-

[edited by: OutdoorWebcams at 8:06 am (utc) on Mar. 14, 2008]

DamonHD

8:07 am on Mar 14, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In some circumstances, eg for .mobi sites, you *must* validate or there are various penalties including having your domain taken away.

Rgds

Damon

OutdoorWebcams

8:22 am on Mar 14, 2008 (gmt 0)

10+ Year Member



Really? Sorry, didn't know that...

(Honestly, I never worried about .mobi domains - you never stop learning! ;-))

swa66

8:19 pm on Mar 14, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Getting code that validates is very important for those of us doing e.g. xhtml. (Hold the preaching against xhtml, no need)

Since adsense use an iframe, getting it to validate under a strict DTD will be kinda hard, but if you email adsense support you should get permission to make the code valid xhtml (anyway I did get it by simply asking many years ago now).

jwgrafflin

10:49 pm on Mar 14, 2008 (gmt 0)

10+ Year Member



Couldn't find any way to contact Google support. But I did find this regarding Adsense search:

Below are the changes you'll need to make for your code to be XHTML compliant:

Remove the closing </input> and </image> tags
Add an additional closing '/' to the end of the opening html tags for <input> and <image>. This should occur for all 'image' and 'input' tags.

For example, this is an unmodified portion of the AdSense for search code:

<img src= [google.com...] border="0"
alt="Google" align="middle"></img></a>
<input type="hidden" name="oe" value="ISO-8859-1"></input>

This is what the modified version would look like:

<img src=" [google.com...] border="0"
alt="Google" align="middle" /></a>
<input type="hidden" name="oe" value="ISO-8859-1" />
Please be sure to modify the search code only as described above since our program policies don't permit any additional modifications. We appreciate your understanding.