#### Beyond Linux® From Scratch (systemd Edition) - Version 11.1

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

- Prev

  docbook-xml-5.0

- Next

  docbook-xsl-nons-1.79.2

- Up
- Home

# docbook-xml-5.1

## Introduction to DocBook XML Schemas 5.1

The DocBook XML Schemas-5.1 package contains schema files and Schematron rules 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.

This package is known to build and work properly using an LFS-11.1 platform.

### Package Information

- Download (HTTP): https://docbook.org/xml/5.1/docbook-v5.1-os.zip

- Download MD5 sum: d8bea8ddfc5743578a31cb18f9ae1f5a

- Download size: 752 KB

- Estimated disk space required: 8.5 MB

- Estimated build time: less than 0.1 SBU

### DocBook XML Schemas 5.1 Dependencies

#### Required

libxml2-2.9.13, sgml-common-0.6.3, and UnZip-6.0

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/docbook51-xml

## Installation of DocBook XML Schemas 5.1

### Note

The package source is distributed in `zip` format and requires unzip. You should create a directory and change to that directory before unzipping the file to ease the removal of the source files after the package has been installed.

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

    install -vdm755 /usr/share/xml/docbook/schema/{rng,sch}/5.1         &&
    install -m644   schemas/rng/* /usr/share/xml/docbook/schema/rng/5.1 &&
    install -m644   schemas/sch/* /usr/share/xml/docbook/schema/sch/5.1 &&
    install -m755   tools/db4-entities.pl /usr/bin                      &&
    install -vdm755 /usr/share/xml/docbook/stylesheet/docbook5          &&
    install -m644   tools/db4-upgrade.xsl \
                    /usr/share/xml/docbook/stylesheet/docbook5

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

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

    xmlcatalog --noout --add "uri" \
      "http://www.oasis-open.org/docbook/xml/5.1/rng/docbook.rng" \
      "file:///usr/share/xml/docbook/schema/rng/5.1/docbook.rng" \
      /etc/xml/docbook-5.1 &&
    xmlcatalog --noout --add "uri" \
      "http://docbook.org/xml/5.1/rng/docbook.rng" \
      "file:///usr/share/xml/docbook/schema/rng/5.1/docbook.rng" \
      /etc/xml/docbook-5.1 &&
    xmlcatalog --noout --add "uri" \
      "http://www.oasis-open.org/docbook/xml/5.1/rng/docbookxi.rng" \
      "file:///usr/share/xml/docbook/schema/rng/5.1/docbookxi.rng" \
      /etc/xml/docbook-5.1 &&
    xmlcatalog --noout --add "uri" \
      "http://docbook.org/xml/5.1/rng/docbookxi.rng" \
      "file:///usr/share/xml/docbook/schema/rng/5.1/docbookxi.rng" \
      /etc/xml/docbook-5.1 &&
    xmlcatalog --noout --add "uri" \
      "http://www.oasis-open.org/docbook/xml/5.1/rnc/docbook.rnc" \
      "file:///usr/share/xml/docbook/schema/rng/5.1/docbook.rnc" \
      /etc/xml/docbook-5.1 &&
    xmlcatalog --noout --add "uri" \
      "http://docbook.org/xml/5.1/rng/docbook.rnc" \
      "file:///usr/share/xml/docbook/schema/rng/5.1/docbook.rnc" \
      /etc/xml/docbook-5.1 &&
    xmlcatalog --noout --add "uri" \
      "http://www.oasis-open.org/docbook/xml/5.1/rnc/docbookxi.rnc" \
      "file:///usr/share/xml/docbook/schema/rng/5.1/docbookxi.rnc" \
      /etc/xml/docbook-5.1 &&
    xmlcatalog --noout --add "uri" \
      "http://docbook.org/xml/5.1/rng/docbookxi.rnc" \
      "file:///usr/share/xml/docbook/schema/rng/5.1/docbookxi.rnc" \
      /etc/xml/docbook-5.1 &&

    xmlcatalog --noout --add "uri" \
      "http://www.oasis-open.org/docbook/xml/5.1/sch/docbook.sch" \
      "file:///usr/share/xml/docbook/schema/sch/5.1/docbook.sch" \
      /etc/xml/docbook-5.1 &&
    xmlcatalog --noout --add "uri" \
      "http://docbook.org/xml/5.1/sch/docbook.sch" \
      "file:///usr/share/xml/docbook/schema/sch/5.1/docbook.sch" \
      /etc/xml/docbook-5.1

While again as the `root` user, create the individual catalogs:

    xmlcatalog --noout --create /usr/share/xml/docbook/schema/rng/5.1/catalog.xml &&

    xmlcatalog --noout --add "uri" \
      "http://docbook.org/xml/5.1/schemas/rng/docbook.schemas/rng" \
      "docbook.schemas/rng" /usr/share/xml/docbook/schema/rng/5.1/catalog.xml &&
    xmlcatalog --noout --add "uri" \
      "http://www.oasis-open.org/docbook/xml/5.1/schemas/rng/docbook.schemas/rng" \
      "docbook.schemas/rng" /usr/share/xml/docbook/schema/rng/5.1/catalog.xml &&
    xmlcatalog --noout --add "uri" \
      "http://docbook.org/xml/5.1/schemas/rng/docbookxi.schemas/rng" \
      "docbookxi.schemas/rng" /usr/share/xml/docbook/schema/rng/5.1/catalog.xml &&
    xmlcatalog --noout --add "uri" \
      "http://www.oasis-open.org/docbook/xml/5.1/schemas/rng/docbookxi.schemas/rng" \
      "docbookxi.schemas/rng" /usr/share/xml/docbook/schema/rng/5.1/catalog.xml &&
    xmlcatalog --noout --add "uri" \
      "http://docbook.org/xml/5.1/schemas/rng/docbook.rnc" \
      "docbook.rnc" /usr/share/xml/docbook/schema/rng/5.1/catalog.xml &&
    xmlcatalog --noout --add "uri" \
      "http://www.oasis-open.org/docbook/xml/5.1/schemas/rng/docbook.rnc" \
      "docbook.rnc" /usr/share/xml/docbook/schema/rng/5.1/catalog.xml &&
    xmlcatalog --noout --add "uri" \
      "http://docbook.org/xml/5.1/schemas/rng/docbookxi.rnc" \
      "docbookxi.rnc" /usr/share/xml/docbook/schema/rng/5.1/catalog.xml &&
    xmlcatalog --noout --add "uri" \
      "http://www.oasis-open.org/docbook/xml/5.1/schemas/rng/docbookxi.rnc" \
      "docbookxi.rnc" /usr/share/xml/docbook/schema/rng/5.1/catalog.xml
    xmlcatalog --noout --create /usr/share/xml/docbook/schema/sch/5.1/catalog.xml &&

    xmlcatalog --noout --add "uri" \
      "http://docbook.org/xml/5.1/schemas/sch/docbook.schemas/sch" \
      "docbook.schemas/sch" /usr/share/xml/docbook/schema/sch/5.1/catalog.xml &&
    xmlcatalog --noout --add "uri" \
      "http://www.oasis-open.org/docbook/xml/5.1/schemas/sch/docbook.schemas/sch" \
      "docbook.schemas/sch" /usr/share/xml/docbook/schema/sch/5.1/catalog.xml

Create (or update) and populate the system XML catalog (`/etc/xml/catalog`) 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//DTD DocBook XML 5.1//EN" \
      "file:///usr/share/xml/docbook/schema/dtd/5.1/catalog.xml" \
      /etc/xml/catalog &&
    xmlcatalog --noout --add "delegateSystem" \
      "http://docbook.org/xml/5.1/dtd/" \
      "file:///usr/share/xml/docbook/schema/dtd/5.1/catalog.xml" \
      /etc/xml/catalog &&
    xmlcatalog --noout --add "delegateURI" \
      "http://docbook.org/xml/5.1/dtd/" \
      "file:///usr/share/xml/docbook/schema/dtd/5.1/catalog.xml" \
      /etc/xml/catalog &&
    xmlcatalog --noout --add "delegateURI" \
      "http://docbook.org/xml/5.1/rng/"  \
      "file:///usr/share/xml/docbook/schema/rng/5.1/catalog.xml" \
      /etc/xml/catalog &&
    xmlcatalog --noout --add "delegateURI" \
      "http://docbook.org/xml/5.1/sch/"  \
      "file:///usr/share/xml/docbook/schema/sch/5.1/catalog.xml" \
      /etc/xml/catalog &&
    xmlcatalog --noout --add "delegateURI" \
      "http://docbook.org/xml/5.1/xsd/"  \
      "file:///usr/share/xml/docbook/schema/xsd/5.1/catalog.xml" \
      /etc/xml/catalog

## Configuring DocBook XML Schemas 5.1

###

#### Config Files

`/etc/xml/catalog` and `/etc/xml/docbook-5.1`

## Contents

Installed Programs: db4-entities.pl
Installed Files: RNC, RNG, SCH, and XSL files
Installed Directories: /etc/xml, /usr/share/xml/docbook/stylesheets, and /usr/share/xml/docbook/schema/{rng,sch}/5.1

### Short Descriptions

`db4-entities.pl` | is a script to convert DocBook 4.x filed to DocBook 5.1
`RNC, RNG, and SCH files` | contain the Docbook 5.1 RelaxNG, RelaxNG Compact, and Schematron schema definitions
`db4-upgrade.xsl` | is an XSL stylesheet to assist in conversion from DocBook 4.x files to DocBook 5.1

Last updated on

- Prev

  docbook-xml-5.0

- Next

  docbook-xsl-nons-1.79.2

- Up
- Home