brian m. carlson brian m. carlson Code version 2 of the GNU General Public License the Creative Commons Attribution-ShareAlike 3.0 License

One thing that many people may not have noticed is that yelp, the GNOME help program, is actually a DocBook 4 viewer. One of the things that it does is render sections in pieces, which requires some specialized code. One thing that it does not do—yet—is render DocBook 5. And since I’d like it to, I’m working on it.

Since the current code base is going to disappear after GNOME 2.30, I’m working on the code for what will become the code for GNOME 3. This is not as difficult as it may seem, since most of the code that needs changing is actually XSLT 1.0.

There are two ways to handle DocBook 5 in stylesheets that are designed to handle DocBook 4. The first way is to use an extension function to strip the namespace that the former has but the latter does not, and then fix up the few cases where semantics or element names differ. This, however, requires processing the XML file twice: once to handle the namespaces and then once to process it normally. This is a problem because it’s slow. Speed is one of the reasons the DocBook XSL sheets weren’t used in the first place.

The second way is to change every match attribute to match the namespaced element as well as the non-namespaced element, and then handle different cases differently. This is the method I’m attempting. Most of the changes in DocBook 5 are not very significant from a stylesheet point of view, and those that are, like ubiquitous linking, and the aforementioned namespace, are easy to handle.

So far, progress is good. Ubiquitous linking is almost ready, and most of the changes are minimally invasive. It’s even possible that the changes could be ready for GNOME 3.0. We’ll see.