xml-format(1) xml-utils xml-format(1) NAME xml-format - Format XML files SYNOPSIS xml-format [-cfIOwh?] [-i ] [-o ] [...] DESCRIPTION The xml-format utility pretty prints an XML document by removing ignor‐ able blank nodes and indenting the XML tree. A text node is considered ignorable if: · its parent does not set or inherit xml:space as "preserve" · its contents are entirely whitespace · all its sibling text nodes are also ignorable · all its ancestors contained only ignorable text nodes OPTIONS -c, --compact Output in compact form without indenting. -f, --overwrite Overwrite input XML files. -h, -?, --help Show usage message. -I, --indent-all Indent nodes within non-blank nodes. Normally, all whitespace within non-blank nodes and their descendants is treated as sig‐ nificant. If -c (--compact) is specified, then this option will allow blank nodes within non-blank nodes to be compacted. -i, --indent Use to indent each level of the XML tree. The default is two spaces. -O, --omit-decl Omit the XML declaration from the formatted XML output. -o, --out Output formatted XML to instead of stdout. -w, --empty Treat elements containing only whitespace as empty. --version Show version information. ... XML file(s) to format. If none are specified, the utility will read from stdin. In addition, the following options allow configuration of the XML pars‐ er: --dtdload Load the external DTD. --huge Remove any internal arbitrary parser limits. --net Allow network access to load external DTD and entities. --noent Resolve entities. --xinclude Do XInclude processing. --xml-catalog Use an XML catalog when resolving entities. Multiple catalogs may be loaded by specifying this option multiple times. EXAMPLES Raw XML: $ cat test.xml
Example A B C

A B C

A B C

See the following list: A B C
Basic formatting: $ xml-format test.xml
Example A B C

A B C

A B C

See the following list: A B C
Using the -I (--indent-all) option: $ cat test1.xml See the following list: A B C $ xml-format -I test1.xml See the following list: A B C Using the -c (--compact) option: $ xml-format test.xml
ExampleA B C

A B C

See the following list: A B C
Using the -c (--compact) and -I (--indent-all) options together: $ xml-format -cI test.xml
ExampleA B C

A B C

See the following list: AB< /para>C
AUTHORS khzae.net. 2020-07-07 xml-format(1)