1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-22 17:02:09 +02:00
tldr/pages/common/xml-format.md
Vitor Henrique 46a054215a
pages*: make help and version commands comply with the style guide (#12107)
* pages*: use generic word for help

* git: add newline to the end

Co-authored-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>

* pages*: make help and version commands comply with the style guide

* java: fix Java name

---------

Co-authored-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
2024-01-30 12:55:24 +08:00

870 B

xml format

Format an XML document. More information: http://xmlstar.sourceforge.net/docs.php.

  • Format an XML document, indenting with tabs:

xml format --indent-tab {{path/to/input.xml|URI}} > {{path/to/output.xml}}

  • Format an HTML document, indenting with 4 spaces:

xml format --html --indent-spaces {{4}} {{path/to/input.html|URI}} > {{path/to/output.html}}

  • Recover parsable parts of a malformed XML document, without indenting:

xml format --recover --noindent {{path/to/malformed.xml|URI}} > {{path/to/recovered.xml}}

  • Format an XML document from stdin, removing the DOCTYPE declaration:

cat {{path\to\input.xml}} | xml format --dropdtd > {{path/to/output.xml}}

  • Format an XML document, omitting the XML declaration:

xml format --omit-decl {{path\to\input.xml|URI}} > {{path/to/output.xml}}

  • Display help:

xml format --help