I am trying to make a subtle customization of DocBook that I suspect would most easily be solved by subclassing the <informaltable>
element. There are several statements that imply subclassing DocBook elements using the role
attribute is possible.
Documentation that Implies Subclassing Using Roles is Possible
Example 1 - From DocBook 5.1: The Definitive Guide - Customizing DocBook
The role attribute, found on almost all of the elements in DocBook, is a text attribute that can be used to subclass an element.
Example 2 - From DocBook 5.1: The Definitive Guide - DocBook Element Reference
While role is a common attribute in the sense that it occurs on all DocBook elements, customizers will find that it is not part of any of the “common attribute” patterns. It is parameterized differently because it is useful to be able to subclass role independently on different elements.
Example 3 - CERN - Writing Documentation Using DocBook
Most DocBook tags contain a common set of attributes. The most often-used such common attributes are lang, which specifies the language of the data inside the element, id labels an element so that it can be referenced by other elements, and role, which allows one to subclass an element, to make it information-wise more specific.
General Google Findings.
Googling combinations of "extend docbook elements role attribute" turns up pages about templates that handle new elements, but doesn't seem to turn up any pages other than the customization examples below that even contemplate subclassing elements using role
attribute.
Customization Examples That Do Exist
There exists examples customizing the formatting of existing DocBook elements, but these are XSLT customizations and do not speak to extending the DocBook schema.
There also exists an example that adds a <sect6>
element, but it seems too verbose to be an efficient means of subclassing, and I suspect that technically that example isn't subclassing at all. Also, that example doesn't seem to make any special use of the role
attribute.
Can Subclassing Using the role
Attribute Really be Accomplished?
It seems from the above examples that the DocBook schema was specifically designed to facilitate subclassing of elements using the role
attribute, however, no concrete example seems to be published.
I am new to both XML and DocBook. Is subclassing a DocBook element so trivial that it goes unnoted? If so, could someone show how it is acheived?
Is subclassing a DocBook element using role
a nice idea that just doesn't work? If so, why doesn't it work?
Note 1:
Whether subclassing <informaltable>
is the right approach to solving my original problem is another question entirely.
Note 2: I had more hyperlinks in my question, but apparently my reputation doesn't allow me to post more than 2 :(