Tuesday, October 2, 2012

Automatically format an XML string

Sometimes you get an XML string and it is unformatted. And doesn't have any tabbing and is hard to read. You can copy and paste this string into a box in the link below and it will do that formatting for you.

Fun tool that I use a lot of:  http://www.freeformatter.com/xml-formatter.html

This is the XML string unformatted
<XML><Items><Item><Id>60000</Id><Varient>CEU-000001</Varient></Item> </Items></XML>'
 
This is the XML string after the formatting
<?xml version="1.0" encoding="UTF-8"?>
<XML>
   <Items>
      <Item>
         <Id>60000</Id>
         <Varient>CEU-000001</Varient>
      </Item>
   </Items>
</XML>

 
It is a really slick tool that is free to use. I know its saved me a ton of time.

No comments:

Post a Comment