Skip to content

A ruby gem which does only one thing: format a XML file from command line with XSLT and Nokogiri.

Notifications You must be signed in to change notification settings

thomd/pretty-xml

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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>

About

A ruby gem which does only one thing: format a XML file from command line with XSLT and Nokogiri.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%