A ruby gem which does only one thing: format a XML file from command line with XSLT and Nokogiri.
Ruby
Switch branches/tags
Nothing to show
Pull request Compare This branch is 13 commits ahead, 11 commits behind jrobertson:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
lib
.gitignore
README.md
Rakefile
pretty-xml.gemspec

README.md

Pretty-XML — Prettify a XML file

A ruby gem which does — for the time being — only one thing: format a XML file.

Generated XML files are often poorly formatted. Use the xmlfo command to properly indent and normalize the file. It will output the XML with consistent indenting, based upon the logical nesting depth of the tags.

Installation

Use jewelers build in functionality to generate *.gemspec files and install gem with

rake gemspec
sudo rake install

Check rake -T for more commands.

Use rocco for generating a rocco-prepared documentation of the xmlfo script:

rocco bin/xmlfo

Usage

Format all xml-files found within the current directory and append a default-postfix _fo (as an abreviation of formatted) to the output filename
(e.g. a file input.xml becomes input_fo.xml):

xmlfo -a

Format all xml-files found within the current directory and append a postfix _postfix to the output filename
(e.g. a file input.xml becomes input_postfix.xml):

xmlfo -a -p postfix
xmlfo -ap postfix

Format the file input.xml only and append the default-postfix _fo to the output filename:

xmlfo <input.xml>

Format the file input.xml only and append a postfix _postfix to the output filename:

xmlfo -p postfix <input.xml>