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).
|
---|
32 |
|
---|
33 | Lynx - http://lynx.browser.org
|
---|
34 |
|
---|
35 |
|
---|
36 | You have everything you need now. Let's install this stuff.
|
---|
37 |
|
---|
38 | Create the /usr/share/docbook directory, cd into it and unpack the
|
---|
39 | docbook-xml dtd archive there.
|
---|
40 |
|
---|
41 | Create the /usr/share/dsssl directory, cd into it and unpack the dsssl
|
---|
42 | stylesheet archive in there. Now copy the lfs.dsl file you will find in
|
---|
43 | the LFS-BOOK XML archive into /usr/share/dsssl/docbook/html
|
---|
44 |
|
---|
45 | The last step is installed OpenJade.
|
---|
46 |
|
---|
47 | In order for openjade to be able to convert the DocBook based documents
|
---|
48 | into other formats, it needs to know where the DocBook DTD related
|
---|
49 | files are located. This is sort of the DocBook equivalent for the $PATH
|
---|
50 | variable. You have two ways of doing this:
|
---|
51 |
|
---|
52 | 1) You can set the $SGML_CATALOG_FILES variable and include the full
|
---|
53 | paths to the catalog files in it
|
---|
54 | or
|
---|
55 | 2) You can hard-code the paths into the openjade binary.
|
---|
56 |
|
---|
57 | If you choose option 1, add the following to your bash configuration
|
---|
58 | file, system wide profile or wherever you wish to include it:
|
---|
59 |
|
---|
60 | export SGML_CATALOG_FILES=/usr/share/docbook.cat:/usr/share/dsssl/docbook/catalog:/usr/share/dsssl/openjade/catalog
|
---|
61 |
|
---|
62 | Followed by installing openjade by running:
|
---|
63 | ./configure --prefix=/usr
|
---|
64 | make
|
---|
65 | make install
|
---|
66 | cp -av dsssl /usr/share/dsssl/openjade
|
---|
67 |
|
---|
68 | If you choose option 2, install OpenJade as follows:
|
---|
69 |
|
---|
70 | ./configure --prefix=/usr \
|
---|
71 | > --enable-default-catalog=/usr/share/docbook.cat:/usr/share/dsssl/docbook/catalog:/usr/share/dsssl/openjade/catalog
|
---|
72 | make
|
---|
73 | make install
|
---|
74 | cp -av dsssl /usr/share/dsssl/openjade
|
---|
75 |
|
---|
76 | And you don't have to worry about the $SGML_CATALOG_FILES variable in
|
---|
77 | this case.
|
---|
78 |
|
---|
79 |
|
---|
80 | You're all set to convert XML to HTML (among a few other formats
|
---|
81 | supported by openjade) now. If you want to convert to PS and PDF as
|
---|
82 | well, install the following two packages.
|
---|
83 |
|
---|
84 | FLTK (you can skip this one if you don't want the X front-end):
|
---|
85 | ./configure --prefix=/usr
|
---|
86 | make
|
---|
87 | make install
|
---|
88 |
|
---|
89 | HTMLDOC:
|
---|
90 | Edit the Makefile.in file and find these lines:
|
---|
91 |
|
---|
92 | install:
|
---|
93 | $(MAKE) all
|
---|
94 | for dir in $(INSTALLDIRS); do\
|
---|
95 | echo Installing in $$dir...;\
|
---|
96 | (cd $$dir; $(MAKE) -$(MAKEFLAGS) clean) || break;\
|
---|
97 | done
|
---|
98 |
|
---|
99 | Change this into:
|
---|
100 |
|
---|
101 | install:
|
---|
102 | $(MAKE) all
|
---|
103 | for dir in $(INSTALLDIRS); do\
|
---|
104 | echo Installing in $$dir...;\
|
---|
105 | (cd $$dir; $(MAKE) -$(MAKEFLAGS) install) || break;\
|
---|
106 | done
|
---|
107 |
|
---|
108 | This will fix that little bug that causes 'make install' to be
|
---|
109 | identical to 'make clean'. Now continue with:
|
---|
110 |
|
---|
111 | ./configure --prefix=/usr
|
---|
112 | make
|
---|
113 | make install
|
---|
114 |
|
---|
115 |
|
---|
116 |
|
---|
117 | The last package is Lynx which will be used for the HTML to TXT
|
---|
118 | conversion. Install it by running:
|
---|
119 |
|
---|
120 | ./configure --prefix=/usr
|
---|
121 | make
|
---|
122 | make install
|
---|
123 |
|
---|
124 | There, all set now. Go back to the README file for some examples how to
|
---|
125 | convert this XML to the various other formats.
|
---|
126 |
|
---|