GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
XML-FORMAT(1) FreeBSD General Commands Manual XML-FORMAT(1)

XML-FORMAT - XML beautifier

xml-format filename

xml-format is an XML beautifier that indents and formats XML files for consistent line length.

As with all file beautifiers, its primary purpose is to take a document created by someone with a perplexing lack of self-discipline and aesthetic sensibility and make it readable.

The XML file is modified in place, and the original document is saved to filename.bak, in case you don't like the results.

Since XML is a class of markup languages, not a markup language, the type of each tag encountered is determined from the type of XML file (DocBook, XHTML, etc.), which, in turn, is inferred from the filename extension (".dbk" for DocBook, ".xhtml" for XHTML, etc.)

There are four types of tags:

Block tags denote blocks of content that should be visually separated from others in the XML source, and often require multiple lines, such as paragraphs, captions, and programlistings. Blocks are separated from other content by a blank line. Content within a block is indented the same as the block tags.

    <para>
    The large forest planet Oglaroon is home to the Oglaroonians,
    an "intelligent" species who maintain an entire civilisation,
    including some extremely small wars, in one small nut tree,
    believing it to be the entire universe, and other trees to be
    merely Oglanut-induced illusions.
    </para>

Line tags denote small but important content items that should be highlighted, but not necessarily use multiple lines, such as titles and index terms. xml-format attempts to keep line tag items to a single, separate line line.

    <title>So Long, and Thanks for all the Fish</title>

Sectioning tags denote structural components of a document, such as chapters, sections, figures, and lists. Opening and closing sectioning tags are placed alone on separate lines. Content between sectioning tags is indented one more level beyond the tags themselves.

<chapter>
    <title>Construction of Earth</title>
    
    <para>
    For a time in the distant past, fjords were fashionable...
    </para>
</chapter>

All other tags that do not fall into the first three categories are considered in-line, and are treated essentially as text, except that they are nestled against the text they surround.

    People were described as daring <emphasis>to boldly split
    infinitives that no man had split before</emphasis>. However,

The type of each tag is determined from simple text files containing lists of each tag name, on per line, in DATADIR/Config/language/<type>-tags.txt.

For example, the tags for DocBook XML are found in:

DATADIR/Config/dbk/block-tags.txt
DATADIR/Config/dbk/line-tags.txt
DATADIR/Config/dbk/sectioning-tags.txt

DATADIR/Config/*/*.txt

dblatex, xmlto

Please report bugs to the author and send patches in unified diff format. (Run man diff for more information.)

Jason W. Bacon

Search for    or go to Top of page |  Section 1 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.