Lunch Shoppe

A place for much random randomness... 
« Back to blog

Pretty Printing XML using Ruby

Here is some code to pretty print using Ruby.
 

 
require 'rexml/document' 
REXML::Document.new(open(ARGV[0]).read).write($stdout, 4) 

 
Just stick it in a xml_pp.rb
file chmod +x and go.

Loading mentions Retweet

Comments (0)

Leave a comment...

 
Got an account with one of these? Login here, or just enter your comment below.
Posterous-login    twitter