Feed on
Posts
Comments

If you’ve ever tried to insert the Google Adsense code directly into your Blogger XML Template as you want ads between post (not in the widget sidebar or anywhere else), you’ll be stunned like me when you get the following error message.

Your template could not be parsed as it is not well-formed. Please make sure all XML elements are closed properly. XML error message: The processing instruction target matching “[xX][mM][lL]” is not allowed.

This is because Blogger uses more strict and standardized XML. The above error simply mean the Adsense code is not standardized XML. To solve this, we need to replace all the html character such as ‘<’ with ‘>’ ‘”‘ with ‘”‘. Check the example below: This is original code.

This is XML standardized code:

You can use your text editor to replace all the HTML manually. Hey why don’t you check out Blogcrowds HTML parser. It is very easy and convenient. Be warned that changing the ads might violate the TOS of your specific ads company. So be sure to check with them to play safe.

The following posts are interesting too

Post-Plugin Library missing

RSS feed | Trackback URI

Comments »

No comments yet.

Name (required)
E-mail (required - never shown publicly)
URI
Your Comment (smaller size | larger size)
You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> in your comment.