O'Reilly logo

DocBook 5: The Definitive Guide by Richard L. Hamilton, Norman Walsh

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Removing Elements

DocBook has a large number of elements. In some authoring environments, it may be useful or necessary to remove unneeded elements.

Removing msgset

The msgset element is a favorite target. It has a complex internal structure designed for describing interrelated error messages, especially on systems that may exhibit messages from several different components. Many technical documents can do without it, and removing it leaves one less complexity to explain to your authors.

Example 5-2 shows a customization layer that removes the msgset element.

Example 5-2. Removing msgset

namespace db = "http://docbook.org/ns/docbook"

include "docbook.rnc" {
   db.msgset = notAllowed
}

The complexity of msgset is really in its msgentry children. DocBook V4.5 introduced a simple alternative, simplemsgentry. Example 5-3 demonstrates how you could allow msgset but only support the simpler alternative.

Example 5-3. Removing msgentry

namespace db = "http://docbook.org/ns/docbook"

include "docbook.rnc" {
   db.msgentry = notAllowed
}

Closer examination of the msgentry content model will reveal that it contains a number of descendants. It isn’t necessary, but it wouldn’t be wrong, to define their patterns as notAllowed as well.

Removing Computer Inlines

DocBook contains a large number of computer inlines. The DocBook inlines define a domain-specific vocabulary. If you’re working in another domain, many of them may be unnecessary.

They’re defined in a set of patterns that ultimately roll up to the db.domain.inlines ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required