1 | Ok, so you have downloaded the XML source. Now what? You are probably
|
---|
2 | wanting to convert these XML files to easier to read HTML, PS, PDF, txt
|
---|
3 | or other formatted files. All that can be read below.
|
---|
4 |
|
---|
5 | Let's start by downloading some software.
|
---|
6 |
|
---|
7 | If all you want to do is being able to convert XML to HTML download the
|
---|
8 | following:
|
---|
9 |
|
---|
10 | OpenJade - http://openjade.sourceforge.net
|
---|
11 | DocBook-XML DTD - http://www.docbook.org/xml/4.1.2/
|
---|
12 | DSSSL DocBook Stylesheets - http://www.nwalsh.com/docbook/dsssl/
|
---|
13 |
|
---|
14 | As the DocBook DTD and Stylesheets are made available as a zip achives you
|
---|
15 | may need to download the unzip package as well if your Linux system doesn't
|
---|
16 | have one:
|
---|
17 |
|
---|
18 | Unzip - ftp://ftp.info-zip.org/pub/infozip/src/
|
---|
19 |
|
---|
20 | If you want to be able to convert the book into PS and PDF as well I
|
---|
21 | recommend using the Htmldoc program. This takes a html file (created
|
---|
22 | with openjade which you already downloaded) and converts it to PS or
|
---|
23 | PDF:
|
---|
24 |
|
---|
25 | HTMLDOC - http://www.easysw.com/htmldoc/
|
---|
26 | FLTK (X front-end) - http://sourceforge.net/projects/fltk
|
---|
27 |
|
---|
28 | If you want to be able to convert the book into TXT as well I recommend
|
---|
29 | using lynx to convert HTML to TXT using the -dump option to lynx. There
|
---|
30 | are most likely better programs to do this, but Lynx is often installed
|
---|
31 | on systems anyways (as a console based web browser). Another often used
|
---|
32 | console based browser is Links which can be used in the same way as
|
---|
33 | Lynx.
|
---|
34 |
|
---|
35 | Lynx - http://lynx.browser.org
|
---|
36 | Links - http://artax.karlin.mff.cuni.cz/~mikulas/links/
|
---|
37 |
|
---|
38 | You have everything you need now. Let's install this stuff.
|
---|
39 |
|
---|
40 | Create the /usr/share/docbook directory, cd into it and unpack the
|
---|
41 | docbook-xml dtd archive there.
|
---|
42 |
|
---|
43 | Create the /usr/share/dsssl directory, cd into it and unpack the dsssl
|
---|
44 | stylesheet archive in there. Now copy the lfs.dsl file you will find in
|
---|
45 | the LFS-BOOK XML archive into /usr/share/dsssl/docbook/html
|
---|
46 |
|
---|
47 | The last step is installing OpenJade.
|
---|
48 |
|
---|
49 | In order for openjade to be able to convert the DocBook based documents
|
---|
50 | into other formats, it needs to know where the DocBook DTD related
|
---|
51 | files are located. This is sort of the DocBook equivalent for the $PATH
|
---|
52 | variable. You have two ways of doing this:
|
---|
53 |
|
---|
54 | 1) You can set the $SGML_CATALOG_FILES variable and include the full
|
---|
55 | paths to the catalog files in it
|
---|
56 | or
|
---|
57 | 2) You can hard-code the paths into the openjade binary.
|
---|
58 |
|
---|
59 | If you choose option 1, add the following to your bash configuration
|
---|
60 | file, system wide profile or wherever you wish to include it:
|
---|
61 |
|
---|
62 | export SGML_CATALOG_FILES=/usr/share/docbook/docbook.cat:/usr/share/dsssl/docbook/catalog:/usr/share/dsssl/openjade/catalog
|
---|
63 |
|
---|
64 | Followed by installing openjade by running:
|
---|
65 | ./configure --prefix=/usr
|
---|
66 | make
|
---|
67 | make install
|
---|
68 | cp -av dsssl /usr/share/dsssl/openjade
|
---|
69 |
|
---|
70 | If you choose option 2, install OpenJade as follows:
|
---|
71 |
|
---|
72 | ./configure --prefix=/usr \
|
---|
73 | > --enable-default-catalog=/usr/share/docbook/docbook.cat:/usr/share/dsssl/docbook/catalog:/usr/share/dsssl/openjade/catalog
|
---|
74 | make
|
---|
75 | make install
|
---|
76 | cp -av dsssl /usr/share/dsssl/openjade
|
---|
77 |
|
---|
78 | And you don't have to worry about the $SGML_CATALOG_FILES variable in
|
---|
79 | this case.
|
---|
80 |
|
---|
81 |
|
---|
82 | You're all set to convert XML to HTML (among a few other formats
|
---|
83 | supported by openjade) now. If you want to convert to PS and PDF as
|
---|
84 | well, install the following two packages.
|
---|
85 |
|
---|
86 | FLTK (you can skip this one if you don't want the X front-end):
|
---|
87 | ./configure --prefix=/usr
|
---|
88 | make
|
---|
89 | make install
|
---|
90 |
|
---|
91 | HTMLDOC:
|
---|
92 | Install by running:
|
---|
93 |
|
---|
94 | ./configure --prefix=/usr
|
---|
95 | make
|
---|
96 | make install
|
---|
97 |
|
---|
98 |
|
---|
99 |
|
---|
100 | The last package is Lynx which will be used for the HTML to TXT
|
---|
101 | conversion. Install it by running:
|
---|
102 |
|
---|
103 | ./configure --prefix=/usr
|
---|
104 | make
|
---|
105 | make install
|
---|
106 |
|
---|
107 | There, all set now. Go back to the README file for some examples how to
|
---|
108 | convert this XML to the various other formats.
|
---|
109 |
|
---|