Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8318195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T21:52:42+00:00 2026-06-08T21:52:42+00:00

I am trying to make a subtle customization of DocBook that I suspect would

  • 0

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 🙁

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T21:52:45+00:00Added an answer on June 8, 2026 at 9:52 pm

    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.

    Example 5.14 of TDG is a very concrete example that shows how to constrain the role attribute on the <procedure> element so that only two values are allowed (by default, any value is allowed). This customization requires modification of the schema. You can do something similar with <informaltable> if you want to.

    And there is nothing stopping you from just using something like

    <informaltable role="myspecialtable">
     ...
    </informaltable>
    

    This is “subclassing” of the simplest kind; no schema changes are needed. How role="myspecialtable" is supposed to be interpreted or processed is entirely up to you.

    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.

    What is your idea of subclassing then?

    Perhaps the term “subclassing” can be bit misleading. DocBook is a markup system, not a programming language. The analogy between subclassing (customizing) a DocBook element and creating a subclass in Java or C++ should not be taken too far.

    There is nothing magical about role. It is just an attribute with no predefined semantics. You don’t have to do anything special with it in order to create a DocBook customization.

    Is subclassing a DocBook element so trivial that it goes unnoted?

    Why do you say that? The whole “Customizing DocBook” chapter is about customization of DocBook elements. It’s not something that goes unnoticed.

    Is subclassing a DocBook element using role a nice idea that just doesn’t work?

    It does work, but perhaps not in the way you expect it to.

    As described above, simply by deciding on a particular value for the role attribute on an element and using it in your document, you are in effect creating a subclass (customization, variant) of that element. That’s it.

    How to use the custom element — how to transform it, filter it, visualize it, and so on — is a different story.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying make an entity with doctrine that has three associations with other entities
Trying to make this jQuery filter that uses .find case-insensitive. For example, when the
I'm trying to make a subtle modification to the partition table of a disk
Trying to make a simple client that consumes a web service using RemObjects SDK,
I'm trying make a function that lists all subkeys of a specific (windows registry)
Trying to make a make generic select control that I can dynamically add elements
Trying to make a simple scroll to top button that smoothly scrolls up and
Trying to make a canvas effect work in IE8. With excanvas.js there is no
I'm trying make an WPF application that I could copy/cut and paste files info
Trying to make a better question There are a lot of images on different

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.