Debian Codegraph @

ru/appa.xml

raw symbols SCIP
1 <appendix id="app-install">
2 <?dbhtml filename="appa.html"?>
3 <appendixinfo>
4 <pubdate>$Date$</pubdate>
5 <releaseinfo>$Revision$</releaseinfo>
6 </appendixinfo>
7 <title>Installation</title>
8 <sect1 id="s-installdtd">
9 <title>Installing the DocBook DTD</title>
10 <para>
11 <indexterm id="docbookinstallappa" class="startofrange"><primary>DocBook DTD</primary>
12 <secondary>installation</secondary></indexterm>
13
14 This appendix describes how to install the DocBook DTD on your system
15 so that popular command-line tools like <application>SP</application> can
16 use it. If you are installing DocBook for use with a commercial application,
17 consult the documentation for your application as well.</para>
18 <para>
19 This appendix describes the installation of DocBook V3.1. If you are using
20 another distribution, the process should be about the same, but there
21 may be minor differences. DocBook V3.1 is backward compatible with DocBook
22 V3.0, and is the recommended distribution at the time of this writing.
23 </para>
24 <sect2>
25 <title>Unpacking the DocBook V3.1 Distribution</title>
26 <para>
27 <indexterm><primary>DocBook DTD</primary>
28 <secondary>online copies</secondary></indexterm>
29 DocBook is distributed on the <ulink
30 url="http://www.oasis-open.org/docbook/">DocBook web
31 site</ulink>. You will also find a copy of the distribution on
32 the <link linkend="app-cdrom">CD-ROM</link>.</para>
33
34 <para>
35 <indexterm><primary>files</primary>
36 <secondary>DocBook DTD distribution</secondary></indexterm>
37
38 The distribution consists of 14 files:</para>
39 <informaltable frame="none">
40 <tgroup cols="2">
41 <colspec colname="COLSPEC0" colwidth="1in"/>
42 <colspec colname="COLSPEC1" colwidth="3.8in"/>
43 <tbody>
44 <row>
45 <entry colname="COLSPEC0" colsep="0" rowsep="0"><filename>31chg.txt</filename></entry>
46 <entry colname="COLSPEC1" colsep="0" rowsep="0">Describes the changes in DocBook
47 V3.1 from the preceding version (3.0)</entry>
48 </row>
49 <row>
50 <entry colname="COLSPEC0" colsep="0" rowsep="0"><filename>40issues.txt</filename></entry>
51 <entry colname="COLSPEC1" colsep="0" rowsep="0">Summarizes backwards-incompatible
52 changes planned for DocBook V4.0</entry>
53 </row>
54 <row>
55 <entry colname="COLSPEC0" colsep="0" rowsep="0"><filename>50issues.txt</filename></entry>
56 <entry colname="COLSPEC1" colsep="0" rowsep="0">Summarizes backwards-incompatible
57 changes planned for DocBook V5.0</entry>
58 </row>
59 <row>
60 <entry colname="COLSPEC0" colsep="0" rowsep="0"><filename>cals-tbl.dtd</filename></entry>
61 <entry colname="COLSPEC1" colsep="0" rowsep="0">The CALS Table Model DTD</entry>
62 </row>
63 <row>
64 <entry colname="COLSPEC0" colsep="0" rowsep="0"><filename>ChangeLog</filename></entry>
65 <entry colname="COLSPEC1" colsep="0" rowsep="0">A GNU-style ChangeLog
66 summarizing the individual edits made on each file in the distribution
67 since V3.0.
68 </entry>
69 </row>
70 <row>
71 <entry colname="COLSPEC0" colsep="0" rowsep="0"><filename>dbcent.mod</filename></entry>
72 <entry colname="COLSPEC1" colsep="0" rowsep="0">The character entity module
73 </entry>
74 </row>
75 <row>
76 <entry colname="COLSPEC0" colsep="0" rowsep="0"><filename>dbgenent.mod</filename></entry>
77 <entry colname="COLSPEC1" colsep="0" rowsep="0">The general entity module
78 </entry>
79 </row>
80 <row>
81 <entry colname="COLSPEC0" colsep="0" rowsep="0"><filename>dbhier.mod</filename></entry>
82 <entry colname="COLSPEC1" colsep="0" rowsep="0">The document hierarchy module</entry>
83 </row>
84 <row>
85 <entry colname="COLSPEC0" colsep="0" rowsep="0"><filename>dbnotn.mod</filename></entry>
86 <entry colname="COLSPEC1" colsep="0" rowsep="0">The notations module</entry>
87 </row>
88 <row>
89 <entry colname="COLSPEC0" colsep="0" rowsep="0"><filename>dbpool.mod</filename></entry>
90 <entry colname="COLSPEC1" colsep="0" rowsep="0">The information pool module
91 </entry>
92 </row>
93 <row>
94 <entry colname="COLSPEC0" colsep="0" rowsep="0"><filename>docbook.cat</filename></entry>
95 <entry colname="COLSPEC1" colsep="0" rowsep="0">A sample OASIS catalog
96 for DocBook</entry>
97 </row>
98 <row>
99 <entry colname="COLSPEC0" colsep="0" rowsep="0"><filename>docbook.dcl</filename></entry>
100 <entry colname="COLSPEC1" colsep="0" rowsep="0">An SGML Declaration suitable
101 for DocBook</entry>
102 </row>
103 <row>
104 <entry colname="COLSPEC0" colsep="0" rowsep="0"><filename>docbook.dtd</filename></entry>
105 <entry colname="COLSPEC1" colsep="0" rowsep="0">The DocBook DTD</entry>
106 </row>
107 <row>
108 <entry colname="COLSPEC0" colsep="0" rowsep="0"><filename>readme.txt</filename></entry>
109 <entry colname="COLSPEC1" colsep="0" rowsep="0">The DocBook V3.1 <quote>readme</quote> file</entry>
110 </row>
111 </tbody>
112 </tgroup>
113 </informaltable>
114 <para>Unpack the distribution into a directory on your system. The exact location
115 is irrelevant. On UNIX systems it's common to put it somewhere under <filename>
116 /usr/local</filename> or <filename>/share</filename> (for example, <filename>/usr/local/sgml/docbook</filename> or <filename>/share/sgml/docbook</filename>).
117 On a PC, perhaps <filename>c:\sgml\docbook</filename>.</para>
118 </sect2>
119 <sect2>
120 <title>Getting the ISO Entity Sets</title>
121 <para>
122 <indexterm><primary>entity sets</primary>
123 <secondary>ISO standard, obtaining</secondary></indexterm>
124 <indexterm><primary>entities</primary>
125 <secondary>entity sets</secondary><see>entity sets</see></indexterm>
126 <indexterm><primary>ISO standards</primary>
127 <secondary>entity sets</secondary>
128 <tertiary>obtaining</tertiary></indexterm>
129 <indexterm><primary>OASIS</primary>
130 <secondary>entity sets (ISO standard), obtaining</secondary></indexterm>
131
132 DocBook refers to a number of standard entity sets that
133 are not distributed with DocBook. (They aren't distributed with
134 DocBook because they aren't maintained by the DocBook
135 TC. They're maintained by ISO.) If you've installed other SGML
136 DTDs or tools, they may already be on your system.</para>
137 <para>If you are missing some of them, they are available from
138 Robin Cover's pages at OASIS: <ulink
139 url="http://www.oasis-open.org/cover/ISOEnts.zip">
140 http://www.oasis-open.org/cover/ISOEnts.zip</ulink>.<footnote>
141 <para>The names of the entity files in this distribution do not
142 exactly match the names of the files used in the catalog file
143 distributed with DocBook (<filename>docbook.cat</filename>). Make sure your
144 catalog file points to the right files.</para></footnote> See <ulink
145 url="http://www.oasis-open.org/cover/topics.html#entities">http://www.oasis-open.org/cover/topics.html#entities</ulink>
146 for more information.
147 </para>
148
149 </sect2>
150 <sect2 id="dbcatalog">
151 <title>The DocBook Catalog</title>
152 <para>
153 <indexterm><primary>public identifiers</primary>
154 <secondary>DocBook DTD</secondary>
155 <tertiary>V3.1</tertiary></indexterm>
156 <indexterm><primary>DocBook DTD</primary>
157 <secondary>public identifiers</secondary></indexterm>
158
159 DocBook uses public identifiers to refer to its
160 constituent parts. In some sense, DocBook <emphasis>is</emphasis>
161 DocBook because it has the formal public
162 identifier <quote><literal>-//OASIS//DTD DocBook V3.1//EN</literal></quote>.
163 In order for tools on your system to
164 find your locally installed copy of DocBook, you must map these
165 public identifiers into system identifiers, i.e., filenames, on
166 your system. For a complete discussion of catalog files,
167 see <xref linkend="s-pid-sid-catalogs"/>.</para>
168
169 <para>
170 <indexterm><primary>catalog files</primary>
171 <secondary>DocBook distribution, installing</secondary></indexterm>
172
173 The DocBook distribution includes a sample catalog, <filename>docbook.cat
174 </filename>, which provides a mapping for all of the public identifiers referenced
175 by DocBook. This mapping won't work <quote>out of the box</quote> for two
176 reasons: first, your tools won't be able to find it, and second, the mappings
177 for the ISO entity sets probably don't point to the right place on your system.
178 </para>
179 <sect3>
180 <title>Finding the Catalog</title>
181 <para>If you've already got some other SGML DTDs installed, you probably already
182 have a catalog file. In this case, the easiest thing to do is append
183 the DocBook catalog entries to the end of your existing catalog and then change
184 them to point to the files on your system.</para>
185
186 <para>If DocBook is the first DTD that you're installing, make a
187 copy of <filename>docbook.cat</filename> and call it
188 <filename>catalog</filename>. Put this file in a higher-level
189 directory and edit the relative pathnames that it contains to point to
190 the actual locations of the files on your system. For example, if you installed DocBook
191 in <filename>/share/sgml/docbk30/</filename>, put the
192 <filename>catalog</filename> in <filename>/share/sgml/</filename>.</para>
193
194 <para>
195 <indexterm><primary>environment</primary>
196 <secondary>variables, setting (catalog files)</secondary></indexterm>
197 <indexterm><primary>SGML_CATALOG_FILES environment variable, setting</primary></indexterm>
198
199 In order for applications to find your catalog file(s), you may have
200 to change the application preferences or set an environment variable. For <application>
201 SP</application> and <application>Jade</application>, set the environment
202 variable <envar>SGML_CATALOG_FILES</envar> to the delimited list of catalog
203 filenames. On my system, this looks like:</para>
204 <screen>SGML_CATALOG_FILES=./catalog;n:/share/sgml/catalog;n:/adept80/doctypes/catalog.jade;j:/jade/catalog
205 </screen>
206 <para>
207 (On a UNIX machine, use colons instead of semicolons to delimit the
208 filenames.)</para>
209 <para>If you don't wish to set the environment variable, you can explicitly
210 pass the name of each catalog to the <application>SP</application> application
211 with the <option>-c</option> option, like this:</para>
212 <screen>nsgmls -c ./catalog -c n:/share/sgml/catalog <replaceable>-c othercatalogs
213 </replaceable> ...</screen>
214 </sect3>
215 <sect3>
216 <title>Fixing the Catalog</title>
217 <para>
218 <indexterm><primary>catalog files</primary>
219 <secondary>mapping to system</secondary></indexterm>
220
221 The basic format of each entry in the DocBook catalog is:</para>
222 <screen>PUBLIC "some public id" "some filename"</screen>
223 <para>What you have to do is change each of the <quote>some filenames</quote>
224 to point to the actual name of the file on your system.</para>
225 <note>
226 <para>
227 <indexterm><primary>filenames</primary>
228 <secondary>catalog file</secondary></indexterm>
229
230 Filenames should be supplied using absolute filenames,
231 or paths relative to the location of
232 the <emphasis>catalog</emphasis> file.</para>
233 </note>
234 <para>To continue with the example above, let's say that you've got:</para>
235 <itemizedlist>
236 <listitem><para>DocBook in <filename>/share/sgml/docbk30/</filename>,</para>
237 </listitem>
238 <listitem><para>The ISO entities in <filename>/share/sgml/entities/8879/</filename>,
239 and</para>
240 </listitem>
241 <listitem><para>Your catalog in <filename>/share/sgml/catalog</filename></para>
242 </listitem>
243 </itemizedlist>
244 <para>Then you would change the catalog entry for the DTD to be:</para>
245 <screen>PUBLIC "-//OASIS//DTD DocBook V3.1//EN" "docbk30/docbook.dtd"
246 </screen>
247 <para>You would change the catalog entry for the general technical character entities to:
248 </para>
249 <screen>PUBLIC "ISO 8879:1986//ENTITIES General Technical//EN" "entities/8879/iso-tech.gml"
250 </screen>
251 <para>And similarly for the other public identifiers used by DocBook. In each
252 case, the filename specified for the public identifier should be the name
253 of the file on your system, specified as an absolute filename, or
254 relative to the location of the <filename>catalog</filename>
255 in which it occurs.</para>
256 </sect3>
257
258 <sect3><title>Mapping System Identifiers for XML</title>
259 <para>
260 <indexterm><primary>XML</primary>
261 <secondary>system identifiers</secondary>
262 <tertiary>mapping</tertiary></indexterm>
263 <indexterm><primary>system identifiers</primary>
264 <secondary>XML</secondary>
265 <tertiary>mapping for</tertiary></indexterm>
266 Since XML documents are required to have system identifiers, but are not
267 required to have public identifiers, it's likely that some of the documents
268 you want to process will only have system identifiers.
269 </para>
270 <para>
271 It turns out that you can still take advantage of the catalog in this case.
272 The <literal>SYSTEM</literal> directive allows you to map the system
273 identifier used in the document to the actual location on your system.
274 </para>
275 <para>
276 Suppose that you work with a colleague who uses the system identifier
277 <quote>file:///c:/sgml/db3xml/db3xml.dtd</quote> to identify the XML version
278 of DocBook on her system. On your system, you want to map that to
279 <quote>/share/sgml/db3xml/db3xml.dtd</quote>. The following entry in
280 your catalog will do the trick:
281 </para>
282 <screen>
283 SYSTEM "http://docbook.org/docbook/xml/1.4/db3xml.dtd" "/share/sgml/db3xml/db3xml.dtd"
284 </screen>
285 <para>
286 Unfortunately, this technique only works with applications that read and
287 understand catalog files.
288 </para>
289 </sect3>
290 </sect2>
291 <sect2>
292 <title>Testing Your Installation</title>
293 <para>
294 <indexterm><primary>DocBook DTD</primary>
295 <secondary>installation</secondary>
296 <tertiary>testing</tertiary></indexterm>
297 <indexterm><primary>nsgmls parser</primary>
298 <secondary>DocBook installation, testing</secondary></indexterm>
299 <indexterm><primary>testing</primary>
300 <secondary>DocBook installation</secondary></indexterm>
301
302 The best way to test your installation is with a simple command-line
303 parser like <command>nsgmls</command> from <application>SP</application>.
304 Create a small test document, like this:</para>
305 <screen>&lt;!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook V3.1//EN">
306 &lt;chapter>&lt;title>Test Chapter&lt;/title>
307 &lt;para>
308 This is a test document.
309 &lt;/para>
310 &lt;/chapter></screen>
311 <para>and run the following command:</para>
312 <screen>nsgmls -sv test.sgm</screen>
313 <para>
314 <indexterm><primary>declarations</primary>
315 <secondary>passing explicitly</secondary></indexterm>
316 <indexterm><primary>DTDDECL</primary>
317 <secondary>warnings (unsupported)</secondary></indexterm>
318
319 If the <command>nsgmls</command> command produces errors, review your
320 catalog and resolve the errors. You can ignore warnings about <literal>DTDDECL
321 </literal> being unsupported. It is unsupported, and there's no way to disable
322 the warning message. Note, however, that this may also affect which SGML declaration
323 gets used. When in doubt, pass the correct declaration explicitly and see
324 if that corrects any problems. (To parse <filename>test.sgm</filename> with
325 the declaration <filename>docbook.dcl</filename> explicitly, run <command>
326 nsgmls -sv docbook.dcl test.sgm</command>.)</para>
327 <para>For some suggestions about how to work around these problems in <application>
328 SP</application> and <application>Jade</application>, see the next section,
329 <xref linkend="s-installjade"/>.
330 </para>
331 </sect2>
332 </sect1>
333 <sect1 id="s-installjade">
334 <title>Installing Jade</title>
335 <para>
336 <indexterm><primary>Jade</primary>
337 <secondary>installing</secondary></indexterm>
338
339 For simplicity, the instructions assume that you are working with
340 Jade on a Microsoft Windows machine. These instructions should be just as
341 useful if you are working on another platform, except for the normal cross-platform
342 idiosyncracies (path and filename separator characters, use of drive letters,
343 etc.).</para>
344 <para>Download and unpack the <ulink url="http://www.jclark.com/jade/">Jade
345 </ulink> distribution. Binary distributions are available for some platforms,
346 which makes installation a simple matter of unpacking the distribution. Or
347 you can build Jade from the source (consult the documentation that comes with
348 Jade for more detail about building it from source).</para>
349 <para>You may wish to add the directory where you installed Jade to your <envar>
350 PATH</envar>. If not, make sure that you use the fully qualified name of the
351 executable when you run the commands below.</para>
352 <sect2>
353 <title>Setting Up the Catalog</title>
354 <para>
355 <indexterm><primary>catalog files</primary>
356 <secondary>Jade, setting up for</secondary></indexterm>
357
358 First, the catalog needs to be set up as described in
359 <xref linkend="dbcatalog"/>
360 in order for Jade to be able to parse your DocBook documents. In addition,
361 Jade comes with its own <filename>catalog</filename> file that you must add
362 to the <envar>SGML_CATALOG_FILES</envar> environment variable or otherwise
363 make available to Jade.</para>
364 </sect2>
365 <sect2>
366 <title>Testing Jade</title>
367 <para>
368 <indexterm><primary>testing</primary>
369 <secondary>Jade</secondary></indexterm>
370
371 Download <ulink url="http://nwalsh.com/docbook/dsssl/doc/testdata/jtest.sgm">
372 <filename>jtest.sgm</filename></ulink> and <ulink url="http://nwalsh.com/docbook/dsssl/doc/testdata/jtest.dsl">
373 <filename>jtest.dsl</filename></ulink>. (Or get them off the CD-ROM in
374 FIXME.) These are self-contained
375 test documents. Test Jade by running:</para>
376 <screen>jade -t rtf -d jtest.dsl jtest.sgm</screen>
377 <para>This command should silently produce <ulink url="http://nwalsh.com/docbook/dsssl/doc/testdata/jtest.rtf">
378 jtest.rtf</ulink>. If you encounter warnings or errors here, Jade is not installed
379 correctly. One possible culprit is your catalog setup. See <xref linkend="jademultdecl"/>.</para>
380 <sect3>
381 <title>DTDDECL Warnings</title>
382 <para>
383 <indexterm><primary>DTDDECL</primary>
384 <secondary>Jade, not supporting</secondary></indexterm>
385
386 One annoying shortcoming in Jade is that it does not support the <literal>
387 DTDDECL</literal> catalog directive and it complains loudly if it encounters
388 one. In Jade, it's almost always possible to work around the problems that <literal>
389 DTDDECL</literal> would solve, so you can generally ignore the warnings.</para>
390 <para>If you also use applications that do understand <literal>DTDDECL</literal>,
391 and find the warnings too distracting to bear, setup alternate catalogs
392 for <application>SP</application> applications, <filename>catalog.jade</filename>,
393 that are identical to your normal catalogs but do not contain any <literal>
394 DTDDECL</literal> entries. You can then avoid the warnings by putting <filename>catalog.jade
395 </filename> in your <envar>SGML_CATALOG_FILES</envar> path, instead of <filename>
396 catalog</filename>.</para>
397 </sect3>
398 </sect2>
399 </sect1>
400 <sect1 id="xinstmds">
401 <title>Installing the Modular<?lb?>DocBook Stylesheets</title>
402 <para>
403 <indexterm><primary>stylesheets</primary>
404 <secondary>installing modular (DocBook)</secondary></indexterm>
405 <indexterm><primary>DocBook DTD</primary>
406 <secondary>stylesheets</secondary>
407 <tertiary>installing</tertiary></indexterm>
408 <indexterm><primary>DSSSL</primary>
409 <secondary>stylesheets</secondary>
410 <tertiary>downloading</tertiary></indexterm>
411 <ulink url="http://nwalsh.com/~ndw/">Norman Walsh</ulink> (one of your
412 intrepid authors ;-) maintains two DSSSL stylesheets for DocBook, one for
413 print and one for online (HTML) output. You can obtain both of these stylesheets
414 from <ulink url="http://nwalsh.com/docbook/dsssl/">http://nwalsh.com/docbook/dsssl/
415 </ulink>. (A recent version is also on
416 the CD-ROM.)</para>
417 <procedure>
418 <step><para>If you have not already done so, download and install the DocBook
419 DTD as described in <xref linkend="s-installdtd"/>.</para>
420 </step>
421 <step><para>Likewise, if Jade is not installed on your system, download
422 and install it as described in <xref linkend="s-installjade"/>.
423 </para></step>
424 <step><para>Download and unpack the <ulink url="http://nwalsh.com/docbook/dsssl/">
425 stylesheet distribution</ulink>.</para>
426 </step>
427 <step><para>
428 <indexterm><primary>testing</primary>
429 <secondary>DSSSL stylesheets installation</secondary></indexterm>
430 <indexterm><primary>HTML</primary>
431 <secondary>stylesheets</secondary>
432 <tertiary>testing (DocBook)</tertiary></indexterm>
433
434 Test the installation by processing <filename>test.sgm</filename>
435 (from the previous section) with Jade:</para>
436 <screen>jade -t rtf -d d:\where-you-unpacked-the-stylesheets\docbook\print\docbook.dsl test.sgm
437 </screen>
438 <para>This command should silently produce <ulink url="http://nwalsh.com/docbook/dsssl/doc/testdata/test.rtf"><filename>
439 test.rtf</filename></ulink>. If not, and the preceding test succeeded, something
440 has gone wrong&mdash;<ulink url="http://nwalsh.com/~ndw/contact.html">contact
441 the maintainer</ulink>.</para>
442 <para>To test the HTML stylesheet, run:</para>
443 <screen>jade -t sgml -d d:\where-you-unpacked-the-stylesheets\docbook\html\docbook.dsl test.sgm
444 </screen>
445 <para>This command should silently produce <ulink url="http://nwalsh.com/docbook/dsssl/doc/testdata/c01.htm"><filename>
446 c01.htm</filename></ulink>. If not, and the preceding test succeeded, something
447 has gone wrong&mdash;<ulink url="http://nwalsh.com/~ndw/contact.html">contact
448 the maintainer</ulink>.<indexterm startref="docbookinstallappa" class="endofrange"/></para>
449 </step>
450 </procedure>
451
452 </sect1>
453 </appendix>
454
455 <!--
456 Local Variables:
457 mode:sgml
458 sgml-parent-document: ("book.sgm" "appendix")
459 End:
460 -->