SYNOPSIS

  xmlpretty [--options] [filename]

DESCRIPTION

xmlpretty is the commandline interface to XML::Handler::YAWriter, acting as a tool to add and remove pretty printing to \s-1XML\s0 files.

xmlpretty has several methods to add human readablitiy.

If you want to add readablity without adding so-called ignorable whitespace, use it in the following way :

$ xmlpretty --AddHiddenNewline \ --AddHiddenAttrTab \ --CatchEmptyElement \ uglyfile.xml > prettyfile.xml

If you do not want to process the file further, but only want it human readable, add visible whitespace to the file as follows :

$ xmlpretty --PrettyWhiteNewline \ --PrettyWhiteIndent \ --CatchEmptyElement \ uglyfile.xml > prettyfile.xml

You may use YAWriter to clean whitespace from \s-1XML\s0 documents. This may work in 99% of the cases where you want to get rid of ignorable whitespace caused by the various forms of pretty printing.

$ xmlpretty --NoWhiteSpace \ --NoComments \ --AddHiddenNewline \ --AddHiddenAttrTab \ --CatchEmptyElement \ prettyfile.xml > cleanfile.xml

Options

Options are given in a gnu like --option idiom.

AddHiddenNewline boolean

Add hidden newline before \*(L">\*(R"

AddHiddenAttrTab boolean

Add hidden tabulation for attributes

CatchEmptyElement boolean

Catch empty Elements, apply \*(L"/>\*(R" compression

CatchWhiteSpace boolean

Catch whitespace with comments

IsSGML boolean

This option will cause start_document, processing_instruction and doctype_decl to appear as \s-1SGML\s0. The \s-1SGML\s0 is still well-formed of course, if your \s-1SAX\s0 events are well-formed.

NoComments boolean

Supress Comments

NoDTD boolean

Supress \s-1DTD\s0

NoPI boolean

Supress Processing Instructions

NoProlog boolean

Supress <?xml ... ?> Prolog

NoWhiteSpace boolean

Supress WhiteSpace to clean documents from prior pretty printing.

PrettyWhiteIndent boolean

Add visible indent before any eventstring

PrettyWhiteNewline boolean

Add visible newlines before any eventstring

\s-1SAX1\s0 boolean (not yet implemented)

Output only \s-1SAX1\s0 compilant eventstrings

Bugs:

Automatic recoding between 8bit and 16bit does not yet work correctly !

I have Perl-5.6 at home and here I can specify \*(L"use utf8;\*(R" in the right places to make recoding work. But I dislike saying \*(L"use 5.00555;\*(R" because many systems run 5.00503.

AUTHOR

Michael Koehne, [email protected]

Thanks

\*(L"Derksen, Eduard (Enno), \s-1CSCIO\s0\*(R" <[email protected]> helped me with the Escape hash and gave quite a lot of useful comments.

RELATED TO xmlpretty…

perl and XML::Parser::PerlSAX