.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "XMLPRETTY 1p" .TH XMLPRETTY 1p 2024-03-08 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME xmlpretty \- XML pretty printer .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& xmlpretty [\-\-options] [filename] .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" \&\fBxmlpretty\fR is the commandline interface to XML::Handler::YAWriter, acting as a tool to add and remove pretty printing to XML files. .PP \&\fBxmlpretty\fR has several methods to add human readablitiy. .PP If you want to add readablity without adding so-called \fIignorable whitespace\fR, use it in the following way : .PP .Vb 4 \& $ xmlpretty \-\-AddHiddenNewline \e \& \-\-AddHiddenAttrTab \e \& \-\-CatchEmptyElement \e \& uglyfile.xml > prettyfile.xml .Ve .PP If you do \fBnot\fR want to process the file further, but only want it human readable, add visible whitespace to the file as follows : .PP .Vb 4 \& $ xmlpretty \-\-PrettyWhiteNewline \e \& \-\-PrettyWhiteIndent \e \& \-\-CatchEmptyElement \e \& uglyfile.xml > prettyfile.xml .Ve .PP You may use YAWriter to clean whitespace from XML 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. .PP .Vb 6 \& $ xmlpretty \-\-NoWhiteSpace \e \& \-\-NoComments \e \& \-\-AddHiddenNewline \e \& \-\-AddHiddenAttrTab \e \& \-\-CatchEmptyElement \e \& prettyfile.xml > cleanfile.xml .Ve .SS Options .IX Subsection "Options" Options are given in a gnu like \-\-option idiom. .IP "AddHiddenNewline boolean" 4 .IX Item "AddHiddenNewline boolean" Add hidden newline before ">" .IP "AddHiddenAttrTab boolean" 4 .IX Item "AddHiddenAttrTab boolean" Add hidden tabulation for attributes .IP "CatchEmptyElement boolean" 4 .IX Item "CatchEmptyElement boolean" Catch empty Elements, apply "/>" compression .IP "CatchWhiteSpace boolean" 4 .IX Item "CatchWhiteSpace boolean" Catch whitespace with comments .IP "IsSGML boolean" 4 .IX Item "IsSGML boolean" This option will cause start_document, processing_instruction and doctype_decl to appear as SGML. The SGML is still well-formed of course, if your SAX events are well-formed. .IP "NoComments boolean" 4 .IX Item "NoComments boolean" Supress Comments .IP "NoDTD boolean" 4 .IX Item "NoDTD boolean" Supress DTD .IP "NoPI boolean" 4 .IX Item "NoPI boolean" Supress Processing Instructions .IP "NoProlog boolean" 4 .IX Item "NoProlog boolean" Supress Prolog .IP "NoWhiteSpace boolean" 4 .IX Item "NoWhiteSpace boolean" Supress WhiteSpace to clean documents from prior pretty printing. .IP "PrettyWhiteIndent boolean" 4 .IX Item "PrettyWhiteIndent boolean" Add visible indent before any eventstring .IP "PrettyWhiteNewline boolean" 4 .IX Item "PrettyWhiteNewline boolean" Add visible newlines before any eventstring .IP "SAX1 boolean (not yet implemented)" 4 .IX Item "SAX1 boolean (not yet implemented)" Output only SAX1 compilant eventstrings .SS Bugs: .IX Subsection "Bugs:" Automatic recoding between 8bit and 16bit does not yet work correctly ! .PP I have Perl\-5.6 at home and here I can specify "use utf8;" in the right places to make recoding work. But I dislike saying "use 5.00555;" because many systems run 5.00503. .SH AUTHOR .IX Header "AUTHOR" Michael Koehne, Kraehe@Copyleft.De .SH Thanks .IX Header "Thanks" "Derksen, Eduard (Enno), CSCIO" helped me with the Escape hash and gave quite a lot of useful comments. .SH "SEE ALSO" .IX Header "SEE ALSO" perl and XML::Parser::PerlSAX