You are here: Home > Google Chrome Tutorial

Solution: Element name g:plusone cannot be represented as XML 1.0

September 08, 2011 08:22 PDT
Google Plus button

Google provides a script for plusone button. Unfortunately, it's not validated by W3C Validator, you will get 2 errors:

Element name g:plusone cannot be represented as XML 1.0.

Element g:plusone not allowed as child of element td in this context. (Suppressing further errors from this subtree.)

Final Solution: Check HTML5 valid syntax option on advance settings

Update on Jan 08, 2012: Google has added a new option named "HTML5 valid syntax" to fix this problem:

  1. Visit plusone button
  2. Click Advanced options, then check the option HTML5 valid syntax
  3. Copy the codes into your site.

To use Google +1 button without w3c errors, There are two ways to fix this problem:

Solution 2: Use JavasScript

Just use document.write to output the plusone code, for example:

<script type="text/javascript">

  document.write('<g:plusone size="medium" href="http://googleplussearch.chromefans.org" count="true"></g:plusone>');

</script>

Solution 3: copy the html code created by google script and modify to conform to w3c standards

This way was published by 911web.org, click here to get details.



#1  iadeo posted on January 06, 2012 16:03 PST
Solution 1 for me
Thanks :o)

Leave your comment
If you want to leave your comment on this article, simply fill out the next form:
Name: * Requirement
E-mail: Optional (won't be published)
Website / Blog: Optional
Are you a human? For anti spammer, please calculate following expression:
8 x 1 + 3 = * Requirement
Comment:
* Requirement
You can use these tags:
[b] Text [/b]: Bold text
[quote] Text [/quote]: Quote text

Social News