Format XML to make it pretty. Dependencies: Nokogiri
Ruby
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
MIT-LICENSE
README.md
gem-public_cert.pem
pretty-xml.gemspec

README.md

Introducing the PrettyXML gem

require 'pretty-xml'
include PrettyXML

xml = "<a1><b1>testing</b1><c>eating<c1>apple</c1>and cooking</a1>"
puts write xml

=begin
output:
<?xml version="1.0" encoding="UTF-8"?>
<a1>
   <b1>testing</b1>
   <c>
      eating
      <c1>apple</c1>
      and cooking
   </c>
</a1>
=end

The PrettyXML gem is a module for use within your own object which needs XML to be pretty.

Resources