TIVI-153: add as dependency for iputils
[profile/ivi/docbook-utils.git] / doc / refentry / sgmldiff.sgml
1 <refentry id="sgmldiff">
2   <docinfo>
3     <author>
4       <firstname>Frederik</firstname> <surname>Fouvry</surname>
5       <affiliation>
6         <address><email>fouvry@sfs.nphil.uni-tuebingen.de</email></address>
7       </affiliation>
8     </author>
9   </docinfo>
10   <refmeta>
11     <refentrytitle>sgmldiff</refentrytitle>
12     <manvolnum>1</manvolnum>
13   </refmeta>
14       
15   <refnamediv>
16     <refname>sgmldiff</refname>
17     <refpurpose>Find differences in the markup of two SGML files</refpurpose>
18   </refnamediv>
19       
20   <refsynopsisdiv>
21     <cmdsynopsis>
22       <command>sgmldiff</command>
23       <arg rep="repeat" choice="opt">options <synopfragmentref linkend="options-sgmldiff"></synopfragmentref></arg>
24       <arg choice="req"><replaceable>file1</replaceable></arg>
25       <arg choice="req"><replaceable>file2</replaceable></arg>
26
27       <synopfragment id="options-sgmldiff"><group>
28         <arg><option>-a</option></arg>
29         <arg><option>--attributes</option></arg><sbr>
30         <arg><option>-c</option> <group><arg>attributes</arg> <arg>nesting</arg> <arg>textpos</arg></group></arg>
31         <arg><option>--context</option> <group><arg>attributes</arg> <arg>nesting</arg> <arg>textpos</arg></group></arg><sbr>
32         <arg><option>-s</option></arg>
33         <arg><option>--statistics</option></arg><sbr>
34         <arg><option>-h</option></arg>
35         <arg><option>--help</option></arg><sbr>
36         <arg><option>-v</option></arg>
37         <arg><option>--version</option></arg>
38       </group></synopfragment>
39
40     </cmdsynopsis>
41   </refsynopsisdiv>
42
43   <refsect1>
44     <title>Description</title>
45
46     <para>This perl script allows to determine the structural differences
47     between two SGML files. It compares the files, regardless of what
48     is in between the tags, to only focus on the markup. Its output
49     is similar to <citerefentry> <refentrytitle>diff</refentrytitle>
50     <manvolnum>1</manvolnum></citerefentry>.</para>
51
52     <para>The typical use of <application>sgmldiff</application> is to
53     compare an SGML file with its translation into another language. If
54     the translation was done cleanly, <application>sgmldiff</application>
55     returns without finding any difference in the markup.</para>
56
57     <para>An example of a typical call to sgmldiff is:</para>
58
59     <screen>
60       sgmldiff english.sgml italiano.sgml
61     </screen>
62
63     <para>If there are differences in markup between both files,
64     <application>sgmldiff</application> will output a series of differences
65     reports summarized with lines of the form:
66     <variablelist>
67       <varlistentry>
68         <term>169a164</term>
69         <listitem><para>At line 169 of the first file, line 164 of the
70         second file has been added.</para></listitem>
71       </varlistentry>
72       <varlistentry>
73          <term>8a12,15</term>
74         <listitem><para>At line 8 of the first file, lines 12 to 15
75         of the second file have been added.</para></listitem>
76       </varlistentry>
77       <varlistentry>
78         <term>41d28</term>
79         <listitem><para>Line 41 of the first file has been destroyed, to
80         obtain line 28 of the second file.</para></listitem>
81       </varlistentry>
82       <varlistentry>
83         <term>63,66d61</term>
84         <listitem><para>Lines 63 to 66 of the first file have been
85         destroyed. to obtain line 61 of the second file.</para></listitem>
86       </varlistentry>
87       <varlistentry>
88         <term>52c51</term>
89         <listitem><para>Line 52 of the first file has been changed into
90         line 51 of the second file.</para></listitem>
91       </varlistentry>
92       <varlistentry>
93         <term>5,7c8,10</term>
94         <listitem><para>Lines 5 to 7 of the first file have been changed
95         into lines 8 to 10 of the second line.</para></listitem>
96       </varlistentry>
97     </variablelist>
98     In addition to those summaries, the lines of the first file are
99     shown preceeded by '<' and the lines of the second file are
100     shown preceeded by '>".</para>
101
102   </refsect1>
103
104   <refsect1>
105     <title>Options</title>
106
107     <para>Here is the list of actions that can be requested to
108     sgmldiff:</para>
109
110     <glosslist>
111       <glossentry>
112         <glossterm>
113           <cmdsynopsis><group>
114             <arg><option>-a</option></arg>
115             <arg><option>--attributes</option></arg>
116           </group></cmdsynopsis>
117         </glossterm>
118         <glossdef>
119           <para>Include the attribute values in the difference tests.
120           Don't set this value if the attributes are likely to be
121           translated. Set this value if the attributes value shouldn't
122           change between both files. Default is to don't include the
123           attributes in the difference tests.</para>
124         </glossdef>       
125       </glossentry>
126
127       <glossentry>
128         <glossterm>
129           <cmdsynopsis><group>
130             <arg><option>-c</option> <group><arg>attributes</arg> <arg>nesting</arg> <arg>textpos</arg></group></arg>
131             <arg><option>--context</option> <group><arg>attributes</arg> <arg>nesting</arg> <arg>textpos</arg></group></arg>
132           </group></cmdsynopsis>
133         </glossterm>
134         <glossdef>
135           <para>Add more context to the difference. Since every test between the tags is removed before testing the differences, <application>sgmldiff</application> is likely to resynchronize itself at the wrong place, by thinking the location in both files correspond, while it's not true. By adding more context to the compared area, such risk is disminished.</para> 
136           <para>The allowed values for the <option>--context</option> option are:
137           <variablelist>
138             <varlistentry>
139               <term>attributes</term>
140               <listitem><para>Take into account the attribute
141               <emphasis>names</emphasis>. The attribute
142               <emphasis>values</emphasis> are controlled by the
143               <option>attributes</option> option.</para></listitem>
144             </varlistentry>
145             <varlistentry>
146               <term>nesting</term>
147               <listitem><para>Take into account the nesting level of all the compared tags.</para></listitem>
148             </varlistentry>
149             <varlistentry>
150               <term>textpos</term>
151               <listitem><para>Take into account the position in the text.</para></listitem>
152             </varlistentry>
153           </variablelist>
154           </para>
155         </glossdef>
156       </glossentry>
157
158       <glossentry>
159         <glossterm>
160           <cmdsynopsis><group>
161             <arg><option>-s</option></arg>
162             <arg><option>--statistics</option></arg>
163           </group></cmdsynopsis>
164         </glossterm>
165         <glossdef>
166           <para>Print some SGML information at the end.</para>
167         </glossdef>
168       </glossentry>
169
170       <glossentry>
171         <glossterm>
172           <cmdsynopsis><group>
173             <arg><option>-h</option></arg>
174             <arg><option>--help</option></arg>
175           </group></cmdsynopsis>
176         </glossterm>
177         <glossdef>
178           <para>Print a short help message and exit</para>
179         </glossdef>       
180       </glossentry>
181
182       <glossentry>
183         <glossterm>
184           <cmdsynopsis><group>
185             <arg><option>-v</option></arg>
186             <arg><option>--version</option></arg>
187           </group></cmdsynopsis>
188         </glossterm>
189         <glossdef>
190           <para>Print the version identifier and exit</para>
191         </glossdef>       
192       </glossentry>
193     </glosslist>      
194
195
196   </refsect1>
197
198   <refsect1>
199     <title>Files</title>
200
201     <para></para>
202
203   </refsect1>
204
205   <refsect1>
206     <title>Authors</title>
207
208     <glosslist>
209
210       <glossentry>
211         <glossterm>
212           Frederik Fouvry
213         </glossterm>
214         <glossdef>
215           <para>Developer of <application>sgmldiff</application>.</para>
216         </glossdef>
217       </glossentry>
218
219     </glosslist>
220
221   </refsect1>
222
223   <refsect1>
224     <title>See Also</title>
225
226     <glosslist>
227
228       <glossentry>
229         <glossterm>
230           <citerefentry> <refentrytitle>jw</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>
231         </glossterm>
232         <glossdef>
233           <para>conversion from a SGML file to other file formats</para>
234         </glossdef>
235       </glossentry>
236
237       <glossentry>
238         <glossterm>
239 <!-- Next line  is a hack to force a paragraph break in the man-page. -->
240 <cmdsynopsis> <command></command> </cmdsynopsis>
241           <citerefentry> <refentrytitle>nsgmls</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>
242         </glossterm>
243         <glossdef>
244           <para>a base component of <application>Jade</application> DSSSL engine</para>
245         </glossdef>
246       </glossentry>
247
248       <glossentry>
249         <glossterm>
250 <!-- Next line  is a hack to force a paragraph break in the man-page. -->
251 <cmdsynopsis> <command></command> </cmdsynopsis>
252           <ulink url="http://sources.redhat.com/docbook-tools/">http://sources.redhat.com/docbook-tools/</ulink>
253         </glossterm>
254         <glossdef>
255           <para>the home page of the DocBook tools, a compendium of
256           all tools necessary to process DocBook files, including
257           the DocBook-utils</para>
258         </glossdef>
259       </glossentry>
260
261     </glosslist>
262   </refsect1>
263
264 </refentry>