1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
|
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>1.
Introduction
</title><meta name="generator" content="DocBook XSL Stylesheets V1.69.1"><link rel="start" href="index.html" title="
The xmlformat XML Document Formatter
"><link rel="up" href="index.html" title="
The xmlformat XML Document Formatter
"><link rel="prev" href="index.html" title="
The xmlformat XML Document Formatter
"><link rel="next" href="how-to-use.html" title="2.
How to Use xmlformat
"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">1.
Introduction
</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="index.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="how-to-use.html">Next</a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="introduction"></a>1.
Introduction
</h2></div></div></div><p>
<span><strong class="command">xmlformat</strong></span> is a formatter (or "pretty-printer") for
XML documents. It is useful when you want XML documents to have a
standard format. This includes situations such as the following:
</p><div class="itemizedlist"><ul type="disc"><li><p>
XML documents that are maintained in a version control system, where
people who use different XML editors work on the documents. XML editors
typically impose their own style conventions on files. The application
of different style conventions to successive document revisions can
result in large version diffs where most of the bulk is related only to
changes in format rather than content. This can be a problem if, for
example, the version control system automatically sends the diffs to a
committer's mailing list that people read. If documents are rewritten to
a common format before they are committed, these diffs become smaller.
They better reflect content changes and are easier for people to scan
and understand.
</p></li><li><p>
Similarly, if you send an XML document to someone who edits it and sends
it back, it's easier to see what was changed by putting the before and
after versions in a common format. This is a simple alternative to using
a more sophisticated semantic XML diff utility.
</p></li></ul></div><p>
Of course, these benefits can be obtained by using any XML pretty
printer. So why does <span><strong class="command">xmlformat</strong></span> exist? Because most
XML formatters reformat documents using a set of built-in rules that
determine the output style. Some allow you to select from one of several
predefined output styles. That's fine if the style you want is the style
produced by one of these tools. If not, you're stuck. That's where
<span><strong class="command">xmlformat</strong></span> comes in, because it's configurable. You
can specify formatting options in a file and
<span><strong class="command">xmlformat</strong></span> will apply them to your documents. If you
have different applications for which you want different styles, you can
select the style by using the appropriate configuration file.
</p><p>
<span><strong class="command">xmlformat</strong></span> has a default overall output style, but you
can redefine the default style, and you can override the default on a
per-element basis. For example, you can indicate whether the element
should be treated as a block element, an inline element, or a verbatim
element. For any block element, you can control several formatting
properties:
</p><div class="itemizedlist"><ul type="disc"><li><p>
Spacing (line breaks) between nested sub-elements. You can also control
spacing between the element's opening and closing tags and its content.
(The general assumption is that if a block element has non-inline
sub-elements, you'll want to space those sub-elements evenly within the
enclosing block, though possibly with different spacing between the
opening tag and the first child, or between the last child and the
closing tag.)
</p></li><li><p>
Indentation of nested sub-elements.
</p></li><li><p>
Whitespace normalization and line-wrapping of text within the element.
</p></li></ul></div><p>
<span><strong class="command">xmlformat</strong></span> is free software. You can redistribute it
or modify it under the terms specified in the
<code class="filename">LICENSE</code> file.
</p><p>
For installation instructions, see the <code class="filename">INSTALL</code>
file.
</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="index.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="how-to-use.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">
The <span><strong class="command">xmlformat</strong></span> XML Document Formatter
</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 2.
How to Use <span><strong class="command">xmlformat</strong></span>
</td></tr></table></div></body></html>
|