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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access