Modularity
Added 26 Jul 2008
Most stylesheets develop and mature over time. The authors and subsequent maintainers come back to them repeatedly, making small and large changes to add features, fix bugs, and adapt them to changing requirements.
The extent to which it is easy or hard to make these changes depends on many things. One of the key factors is stylesheet modularity: how easy is it to identify and isolate the parts that have to be changed and change them without breaking everything that used to work.
The DocBook stylesheets have been developed with the following general guidelines in mind.
-
Match templates are more flexible than named templates
Match templates are very data-driven. Supporting new or rearranged content models in a stylesheet that uses match templates often requires little more than adding or changing a few templates. Named templates are much more procedural. Changing a complex chain of called templates often requires new variables, new conditional statements, and even more complexity.