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 Attributes

Just as there may be more elements than you need, there may be more attributes.

Suppose your processing system doesn’t support continued lists. You want to remove the continuation attribute from the orderedlist element. There are two ways you could accomplish this. One way would be to redefine the db.orderedlist.continuation.attribute pattern as not allowed; the other would be to redefine the db.orderedlist.attlist pattern so that it does not include the continuation attribute. Either will accomplish the goal. Example 5-10 uses the first method.

Example 5-10. Removing continuation from orderedlist

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

include "docbook.rnc" {
   db.orderedlist.continuation.attribute = empty
}

Subsetting the Common Attributes

DocBook defines a set of common attributes, which appear on every element. Depending on how you process your documents, removing some of them can both simplify the authoring task and improve processing speed.

Some obvious candidates are:

Effectivity attributes (arch, os, condition...)

If you’re not using all of the effectivity attributes in your documents, you can get rid of up to seven attributes in one fell swoop.

xml:lang

If you’re not producing multilingual documents, you can remove xml:lang.

remap

The remap attribute is designed to hold the name of a semantically equivalent construct from a previous markup scheme (e.g., a Microsoft Word–style template name, if you’re converting from Word). If you’re authoring from scratch, ...

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