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.
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
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>