docbook-xml-4.5

#### Beyond Linux® From Scratch (systemd Edition) - Version r13.0-1303

### Chapter 49. Extensible Markup Language (XML)

- Prev

  Extensible Markup Language (XML)

- Next

  docbook-xml-5.0

- Up
- Home

# docbook-xml-4.5

## Introduction to DocBook-4.5 XML DTD

The DocBook-4.5 XML DTD-4.5 package contains document type definitions for verification of XML data files against the DocBook rule set. These are useful for structuring books and software documentation to a standard allowing you to utilize transformations already written for that standard.

### Note

Development versions of BLFS may not build or run some packages properly if LFS or dependencies have been updated since the most recent stable versions of the books.

### Package Information

- Download (HTTP): https://archive.docbook.org/xml/4.5/docbook-xml-4.5.zip

- Download MD5 sum: 03083e288e87a7e829e437358da7ef9e

- Download size: 96 KB

- Estimated disk space required: 1.2 MB

- Estimated build time: less than 0.1 SBU

### DocBook-4.5 XML DTD Dependencies

#### Required

libxml2-2.15.3

## Installation of DocBook-4.5 XML DTD

### Note

The package source is distributed in `zip` format and you can use the python3 -m zipfile -e `<name>`.zip `<name>` command to extract it. The last parameter, ``<name>``, ensures to extract the content of the zip archive into the directory named ``<name>`` (it will be automatically created if it does not exist yet), so after the package has been installed the removal of the source files will be easier.

Install DocBook XML DTD by running the following commands as the `root` user:

    install -v -d -m755 /usr/share/xml/docbook/xml-dtd-4.5 &&
    install -v -d -m755 /etc/xml                           &&
    cp -v -af --no-preserve=ownership                      \
        catalog.xml docbook.cat *.dtd ent/ *.mod           \
        /usr/share/xml/docbook/xml-dtd-4.5

The shipped `catalog.xml` file handles the formal public identifiers of the DocBook-4.5 XML DTD. We need add some entries into its installation to handle the URLs of the DTD as well, by running the following commands as the `root` user:

    xmlcatalog --noout --add "rewriteSystem"        \
        "http://www.oasis-open.org/docbook/xml/4.5" \
        "file:///usr/share/xml/docbook/xml-dtd-4.5" \
        /usr/share/xml/docbook/xml-dtd-4.5/catalog.xml &&

    xmlcatalog --noout --add "rewriteURI"           \
        "http://www.oasis-open.org/docbook/xml/4.5" \
        "file:///usr/share/xml/docbook/xml-dtd-4.5" \
        /usr/share/xml/docbook/xml-dtd-4.5/catalog.xml

Create (or update) and populate the `/etc/xml/catalog` catalog file by running the following commands as the `root` user:

    if [ ! -e /etc/xml/catalog ]; then
        xmlcatalog --noout --create /etc/xml/catalog
    fi &&

    xmlcatalog --noout --add "delegatePublic"                   \
        "-//OASIS//ENTITIES DocBook XML"                        \
        "file:///usr/share/xml/docbook/xml-dtd-4.5/catalog.xml" \
        /etc/xml/catalog                                        &&

    xmlcatalog --noout --add "delegatePublic"                   \
        "-//OASIS//DTD DocBook XML"                             \
        "file:///usr/share/xml/docbook/xml-dtd-4.5/catalog.xml" \
        /etc/xml/catalog                                        &&

    xmlcatalog --noout --add "delegateSystem"                   \
        "http://www.oasis-open.org/docbook/"                    \
        "file:///usr/share/xml/docbook/xml-dtd-4.5/catalog.xml" \
        /etc/xml/catalog                                        &&

    xmlcatalog --noout --add "delegateURI"                      \
        "http://www.oasis-open.org/docbook/"                    \
        "file:///usr/share/xml/docbook/xml-dtd-4.5/catalog.xml" \
        /etc/xml/catalog

## Configuring DocBook-4.5 XML DTD

### Config Files

`/etc/xml/catalog`

### Configuration Information

### Caution

Various BLFS packages request DocBook XML DTD version 4.x before V4.5, so the following step must be done for those packages to be built successfully.

The above installation creates the files and updates the catalogs. In order to utilize DocBook XML DTD V4.5 when any version 4.x is requested in the System Identifier, you need to add additional statements to the catalog files. If you have any of the DocBook XML DTD's referenced below already installed on your system, remove those entries from the for command below (issue the commands as the `root` user):

    for DTDVERSION in 4.1.2 4.2 4.3 4.4
    do
      xmlcatalog --noout --add "public"                                  \
        "-//OASIS//DTD DocBook XML V$DTDVERSION//EN"                     \
        "http://www.oasis-open.org/docbook/xml/$DTDVERSION/docbookx.dtd" \
        /usr/share/xml/docbook/xml-dtd-4.5/catalog.xml

      xmlcatalog --noout --add "rewriteSystem"              \
        "http://www.oasis-open.org/docbook/xml/$DTDVERSION" \
        "file:///usr/share/xml/docbook/xml-dtd-4.5"         \
        /usr/share/xml/docbook/xml-dtd-4.5/catalog.xml

      xmlcatalog --noout --add "rewriteURI"                 \
        "http://www.oasis-open.org/docbook/xml/$DTDVERSION" \
        "file:///usr/share/xml/docbook/xml-dtd-4.5"         \
        /usr/share/xml/docbook/xml-dtd-4.5/catalog.xml
    done

## Contents

Installed Programs: None
Installed Libraries: None
Installed Files: DTD, MOD and ENT files
Installed Directories: /etc/xml and /usr/share/xml/docbook/xml-dtd-4.5

### Short Descriptions

`DTD files` | contain a document type definition which defines the element types and the attribute lists that can be used in the corresponding `XML` files
`MOD files` | contain components of the document type definition that are sourced into the `DTD` files
`ENT files` | contain lists of named character entities allowed in HTML

- Prev

  Extensible Markup Language (XML)

- Next

  docbook-xml-5.0

- Up
- Home