Element name gcse:searchbox-only cannot be represented as XML 1.0

user379888 picture user379888 · Oct 4, 2012 · Viewed 9.6k times · Source

I am getting the following error in w3 validator,

 Line 62, Column 140: Element name gcse:searchbox-only cannot be represented as XML 1.0.

I am using Google search bar inside website which is added by this code,

<gcse:searchbox-only></gcse:searchbox-only>

Please help out to avoid this error. Thanks

Answer

Jan M picture Jan M · Oct 18, 2012

I found this answer hidden in the google docs:

https://developers.google.com/custom-search/docs/element#html5

HTML5-valid div tags

You can use HTML5-valid div tags as long as you observe these guidelines:

  • The class attribute must be set to gcse-XXX
  • Any attributes must be prefixed with data-.

For example:

<div class="gcse-searchbox" data-resultsUrl="http://www.example.com" data-newWindow="true" data-queryParameterName="search" >