summaryrefslogtreecommitdiff
path: root/doc/refentry/sgmldiff.sgml
blob: 67ec57b3e04886d40e630d1407e912bd29dde1a5 (plain)
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
<refentry id="sgmldiff">
  <docinfo>
    <author>
      <firstname>Frederik</firstname> <surname>Fouvry</surname>
      <affiliation>
        <address><email>fouvry@sfs.nphil.uni-tuebingen.de</email></address>
      </affiliation>
    </author>
  </docinfo>
  <refmeta>
    <refentrytitle>sgmldiff</refentrytitle>
    <manvolnum>1</manvolnum>
  </refmeta>
      
  <refnamediv>
    <refname>sgmldiff</refname>
    <refpurpose>Find differences in the markup of two SGML files</refpurpose>
  </refnamediv>
      
  <refsynopsisdiv>
    <cmdsynopsis>
      <command>sgmldiff</command>
      <arg rep="repeat" choice="opt">options <synopfragmentref linkend="options-sgmldiff"></synopfragmentref></arg>
      <arg choice="req"><replaceable>file1</replaceable></arg>
      <arg choice="req"><replaceable>file2</replaceable></arg>

      <synopfragment id="options-sgmldiff"><group>
        <arg><option>-a</option></arg>
        <arg><option>--attributes</option></arg><sbr>
        <arg><option>-c</option> <group><arg>attributes</arg> <arg>nesting</arg> <arg>textpos</arg></group></arg>
        <arg><option>--context</option> <group><arg>attributes</arg> <arg>nesting</arg> <arg>textpos</arg></group></arg><sbr>
        <arg><option>-s</option></arg>
        <arg><option>--statistics</option></arg><sbr>
        <arg><option>-h</option></arg>
        <arg><option>--help</option></arg><sbr>
        <arg><option>-v</option></arg>
        <arg><option>--version</option></arg>
      </group></synopfragment>

    </cmdsynopsis>
  </refsynopsisdiv>

  <refsect1>
    <title>Description</title>

    <para>This perl script allows to determine the structural differences
    between two SGML files. It compares the files, regardless of what
    is in between the tags, to only focus on the markup. Its output
    is similar to <citerefentry> <refentrytitle>diff</refentrytitle>
    <manvolnum>1</manvolnum></citerefentry>.</para>

    <para>The typical use of <application>sgmldiff</application> is to
    compare an SGML file with its translation into another language. If
    the translation was done cleanly, <application>sgmldiff</application>
    returns without finding any difference in the markup.</para>

    <para>An example of a typical call to sgmldiff is:</para>

    <screen>
      sgmldiff english.sgml italiano.sgml
    </screen>

    <para>If there are differences in markup between both files,
    <application>sgmldiff</application> will output a series of differences
    reports summarized with lines of the form:
    <variablelist>
      <varlistentry>
        <term>169a164</term>
        <listitem><para>At line 169 of the first file, line 164 of the
        second file has been added.</para></listitem>
      </varlistentry>
      <varlistentry>
         <term>8a12,15</term>
        <listitem><para>At line 8 of the first file, lines 12 to 15
        of the second file have been added.</para></listitem>
      </varlistentry>
      <varlistentry>
        <term>41d28</term>
        <listitem><para>Line 41 of the first file has been destroyed, to
        obtain line 28 of the second file.</para></listitem>
      </varlistentry>
      <varlistentry>
        <term>63,66d61</term>
        <listitem><para>Lines 63 to 66 of the first file have been
        destroyed. to obtain line 61 of the second file.</para></listitem>
      </varlistentry>
      <varlistentry>
        <term>52c51</term>
        <listitem><para>Line 52 of the first file has been changed into
        line 51 of the second file.</para></listitem>
      </varlistentry>
      <varlistentry>
        <term>5,7c8,10</term>
        <listitem><para>Lines 5 to 7 of the first file have been changed
        into lines 8 to 10 of the second line.</para></listitem>
      </varlistentry>
    </variablelist>
    In addition to those summaries, the lines of the first file are
    shown preceeded by '<' and the lines of the second file are
    shown preceeded by '>".</para>

  </refsect1>

  <refsect1>
    <title>Options</title>

    <para>Here is the list of actions that can be requested to
    sgmldiff:</para>

    <glosslist>
      <glossentry>
        <glossterm>
          <cmdsynopsis><group>
            <arg><option>-a</option></arg>
            <arg><option>--attributes</option></arg>
          </group></cmdsynopsis>
        </glossterm>
        <glossdef>
          <para>Include the attribute values in the difference tests.
          Don't set this value if the attributes are likely to be
          translated. Set this value if the attributes value shouldn't
          change between both files. Default is to don't include the
          attributes in the difference tests.</para>
        </glossdef>	  
      </glossentry>

      <glossentry>
        <glossterm>
          <cmdsynopsis><group>
            <arg><option>-c</option> <group><arg>attributes</arg> <arg>nesting</arg> <arg>textpos</arg></group></arg>
            <arg><option>--context</option> <group><arg>attributes</arg> <arg>nesting</arg> <arg>textpos</arg></group></arg>
          </group></cmdsynopsis>
        </glossterm>
        <glossdef>
          <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> 
          <para>The allowed values for the <option>--context</option> option are:
          <variablelist>
            <varlistentry>
              <term>attributes</term>
              <listitem><para>Take into account the attribute
              <emphasis>names</emphasis>. The attribute
              <emphasis>values</emphasis> are controlled by the
              <option>attributes</option> option.</para></listitem>
            </varlistentry>
            <varlistentry>
              <term>nesting</term>
              <listitem><para>Take into account the nesting level of all the compared tags.</para></listitem>
            </varlistentry>
            <varlistentry>
              <term>textpos</term>
              <listitem><para>Take into account the position in the text.</para></listitem>
            </varlistentry>
          </variablelist>
          </para>
        </glossdef>
      </glossentry>

      <glossentry>
        <glossterm>
          <cmdsynopsis><group>
            <arg><option>-s</option></arg>
            <arg><option>--statistics</option></arg>
          </group></cmdsynopsis>
        </glossterm>
        <glossdef>
          <para>Print some SGML information at the end.</para>
        </glossdef>
      </glossentry>

      <glossentry>
        <glossterm>
          <cmdsynopsis><group>
            <arg><option>-h</option></arg>
            <arg><option>--help</option></arg>
          </group></cmdsynopsis>
        </glossterm>
        <glossdef>
          <para>Print a short help message and exit</para>
        </glossdef>	  
      </glossentry>

      <glossentry>
        <glossterm>
          <cmdsynopsis><group>
            <arg><option>-v</option></arg>
            <arg><option>--version</option></arg>
          </group></cmdsynopsis>
        </glossterm>
        <glossdef>
          <para>Print the version identifier and exit</para>
        </glossdef>	  
      </glossentry>
    </glosslist>      


  </refsect1>

  <refsect1>
    <title>Files</title>

    <para></para>

  </refsect1>

  <refsect1>
    <title>Authors</title>

    <glosslist>

      <glossentry>
        <glossterm>
          Frederik Fouvry
        </glossterm>
        <glossdef>
          <para>Developer of <application>sgmldiff</application>.</para>
        </glossdef>
      </glossentry>

    </glosslist>

  </refsect1>

  <refsect1>
    <title>See Also</title>

    <glosslist>

      <glossentry>
        <glossterm>
          <citerefentry> <refentrytitle>jw</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>
        </glossterm>
        <glossdef>
          <para>conversion from a SGML file to other file formats</para>
        </glossdef>
      </glossentry>

      <glossentry>
        <glossterm>
<!-- Next line  is a hack to force a paragraph break in the man-page. -->
<cmdsynopsis> <command></command> </cmdsynopsis>
          <citerefentry> <refentrytitle>nsgmls</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>
        </glossterm>
        <glossdef>
          <para>a base component of <application>Jade</application> DSSSL engine</para>
        </glossdef>
      </glossentry>

      <glossentry>
        <glossterm>
<!-- Next line  is a hack to force a paragraph break in the man-page. -->
<cmdsynopsis> <command></command> </cmdsynopsis>
          <ulink url="http://sources.redhat.com/docbook-tools/">http://sources.redhat.com/docbook-tools/</ulink>
        </glossterm>
        <glossdef>
          <para>the home page of the DocBook tools, a compendium of
          all tools necessary to process DocBook files, including
          the DocBook-utils</para>
        </glossdef>
      </glossentry>

    </glosslist>
  </refsect1>

</refentry>