[2fadfb6] | 1 | Ok, so you have downloaded the XML source. Now what? You are probably
|
---|
[eec26a5] | 2 | wanting to convert these XML files to easier to read HTML, PS, PDF, TXT
|
---|
[2fadfb6] | 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 |
|
---|
[9c99d2d] | 10 | OpenJade - http://openjade.sourceforge.net/
|
---|
[2fadfb6] | 11 | DocBook-XML DTD - http://www.docbook.org/xml/4.1.2/
|
---|
[d1a50e0] | 12 | Modified DocBook Entities -
|
---|
| 13 | http://ftp.linuxfromscratch.org/misc/docbook-4.1.2-newent.tar.bz2
|
---|
[2fadfb6] | 14 | DSSSL DocBook Stylesheets - http://www.nwalsh.com/docbook/dsssl/
|
---|
| 15 |
|
---|
[93bd6644] | 16 | As the DocBook DTD and Stylesheets are made available as zip archives you
|
---|
[2fadfb6] | 17 | may need to download the unzip package as well if your Linux system doesn't
|
---|
| 18 | have one:
|
---|
| 19 |
|
---|
[4ea8044] | 20 | Unzip - ftp://ftp.uu.net/pub/archiving/zip/src/
|
---|
[2fadfb6] | 21 |
|
---|
| 22 | If you want to be able to convert the book into PS and PDF as well I
|
---|
| 23 | recommend using the Htmldoc program. This takes a html file (created
|
---|
| 24 | with openjade which you already downloaded) and converts it to PS or
|
---|
| 25 | PDF:
|
---|
| 26 |
|
---|
| 27 | HTMLDOC - http://www.easysw.com/htmldoc/
|
---|
| 28 | FLTK (X front-end) - http://sourceforge.net/projects/fltk
|
---|
| 29 |
|
---|
| 30 | If you want to be able to convert the book into TXT as well I recommend
|
---|
[61d9fcc] | 31 | using lynx to convert HTML to TXT using the -dump option to lynx.
|
---|
[2fadfb6] | 32 |
|
---|
[93bd6644] | 33 | Lynx - http://lynx.browser.org
|
---|
| 34 |
|
---|
[2fadfb6] | 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
|
---|
[78ece076] | 39 | docbook-xml dtd archive there. Move all the files and directories from
|
---|
| 40 | the newly created subdirectory to the current directory
|
---|
| 41 | (/usr/share/docbook). We don't really need a
|
---|
| 42 | /usr/share/docbook/docbook-<version> subdir for our purposes.
|
---|
[2fadfb6] | 43 |
|
---|
[9c99d2d] | 44 | Remove the ent directory and unpack the docbook-4.1.2-newent.tar.bz2 file.
|
---|
| 45 | This will create a new ent directory with entity files that work better
|
---|
| 46 | with XML.
|
---|
| 47 |
|
---|
[2fadfb6] | 48 | Create the /usr/share/dsssl directory, cd into it and unpack the dsssl
|
---|
[e720717] | 49 | stylesheet archive in there. Rename the directory that's created by tar
|
---|
| 50 | into 'docbook'. Now copy the lfs.dsl file you will find in
|
---|
[2fadfb6] | 51 | the LFS-BOOK XML archive into /usr/share/dsssl/docbook/html
|
---|
| 52 |
|
---|
[30ae6314] | 53 | The last step is installing OpenJade.
|
---|
[2fadfb6] | 54 |
|
---|
| 55 | In order for openjade to be able to convert the DocBook based documents
|
---|
| 56 | into other formats, it needs to know where the DocBook DTD related
|
---|
| 57 | files are located. This is sort of the DocBook equivalent for the $PATH
|
---|
| 58 | variable. You have two ways of doing this:
|
---|
| 59 |
|
---|
| 60 | 1) You can set the $SGML_CATALOG_FILES variable and include the full
|
---|
| 61 | paths to the catalog files in it
|
---|
| 62 | or
|
---|
| 63 | 2) You can hard-code the paths into the openjade binary.
|
---|
| 64 |
|
---|
| 65 | If you choose option 1, add the following to your bash configuration
|
---|
| 66 | file, system wide profile or wherever you wish to include it:
|
---|
| 67 |
|
---|
[785e237] | 68 | export SGML_CATALOG_FILES=/usr/share/docbook/docbook.cat:/usr/share/dsssl/docbook/catalog:/usr/share/dsssl/openjade/catalog
|
---|
[2fadfb6] | 69 |
|
---|
| 70 | Followed by installing openjade by running:
|
---|
| 71 | ./configure --prefix=/usr
|
---|
| 72 | make
|
---|
| 73 | make install
|
---|
| 74 | cp -av dsssl /usr/share/dsssl/openjade
|
---|
| 75 |
|
---|
| 76 | If you choose option 2, install OpenJade as follows:
|
---|
| 77 | ./configure --prefix=/usr \
|
---|
[785e237] | 78 | > --enable-default-catalog=/usr/share/docbook/docbook.cat:/usr/share/dsssl/docbook/catalog:/usr/share/dsssl/openjade/catalog
|
---|
[2fadfb6] | 79 | make
|
---|
| 80 | make install
|
---|
| 81 | cp -av dsssl /usr/share/dsssl/openjade
|
---|
| 82 |
|
---|
| 83 | And you don't have to worry about the $SGML_CATALOG_FILES variable in
|
---|
| 84 | this case.
|
---|
| 85 |
|
---|
| 86 |
|
---|
| 87 | You're all set to convert XML to HTML (among a few other formats
|
---|
| 88 | supported by openjade) now. If you want to convert to PS and PDF as
|
---|
| 89 | well, install the following two packages.
|
---|
| 90 |
|
---|
| 91 | FLTK (you can skip this one if you don't want the X front-end):
|
---|
| 92 | ./configure --prefix=/usr
|
---|
| 93 | make
|
---|
| 94 | make install
|
---|
| 95 |
|
---|
[93bd6644] | 96 | Install HTMLDOC by running:
|
---|
[2fadfb6] | 97 | ./configure --prefix=/usr
|
---|
| 98 | make
|
---|
| 99 | make install
|
---|
| 100 |
|
---|
| 101 |
|
---|
[61d9fcc] | 102 | The last package is Lynx which will be used for the HTML to TXT
|
---|
[2fadfb6] | 103 | conversion. Install it by running:
|
---|
| 104 | ./configure --prefix=/usr
|
---|
| 105 | make
|
---|
| 106 | make install
|
---|
| 107 |
|
---|
| 108 | There, all set now. Go back to the README file for some examples how to
|
---|
| 109 | convert this XML to the various other formats.
|
---|
| 110 |
|
---|