Free Information Technology Magazines and eBooks

Thursday, April 23, 2009

How to post XML or HTML code on Blogger

Since my site is contains article about programming. I often post sample sourcecode, XML and HTML scripts. My previous dilemma was, I can't simply copy and paste the codes directly to blogger editor because it will translate all entities enclosed with greater & less than sign such as <element>. The simplest way to do it is to encode the XML/HMTL code first using encoder tools which are available online.

Here's a step-by-step procedure:

1. Go to http://centricle.com/tools/html-entities/

post XML or HTML code on Blogger

2. Copy and Paste your code on the textbox then click encode.

3. Copy the encoded code to your Blogger editor.

That's It. Problem solved. Good Luck!

2 comments:

WizzoDawg said...

Tried it, but it doesn't do XSL very well, and the resulting formatting displays all out of whack.

There's got to be a better way to post code.

Fryan Valdez said...

I tried some xsl and the site encoded it just fine. But your right, the formatting displays is not too good, you need to do some adjustment (like adding tab or spaces) to format the display properly. But for me, this is easier than typing the encoded entities by yourself. My 2 cents :)