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:langIf you’re not producing multilingual documents, you can remove
xml:lang.remapThe
remapattribute 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, ...
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