About Arbortext Styler > Working with Modules > Modules Overview
  
Modules Overview
Arbortext Styler supports modularized stylesheets, which enables you to develop a stylesheet from modular components. Multiple stylesheets can share common modules, which adds flexibility to stylesheet design and reduces development time. You can also reference a fully developed stylesheet as a module and selectively override some of the formatting characteristics. Using modules makes it easier to maintain multiple stylesheets with common styling. If having the best possible performance when publishing is one of your requirements, you can use File > Save as Merged Stylesheet to save a modular stylesheet as a merged, flattened stylesheet. It is recommended that you edit the individual stylesheet modules themselves, and then use the merged stylesheet for production work to ensure the best performance when publishing.
A stylesheet can reference any other stylesheet as a module. You can also reference read-only modules, though you cannot modify the contents of those modules. You can use the Arbortext-path\custom\stylermodules directory to store modules.
Modularized stylesheets are arranged in a module hierarchy. The hierarchy starts with a single root module that can reference any number of other modules. Modules in the hierarchy can reference other modules down to the leaf module level. Modules higher in the hierarchy have precedence over modules lower in the hierarchy. Any mergeable definitions in modules lower in the hierarchy are overridden by identically named definitions higher in the hierarchy.
The following stylesheet components are considered definitions:
Element
Property set
Page set
Page type
Page region
Generated content
Table of contents
Cross reference
Custom table
Size
Combined font
A module can contain and share any or all of these types of definitions. For example, if you have defined header and footer objects for the stylesheet axdocbook1.style and you wish to make these available for a second stylesheet axdocbook2.style without having to recreate the same objects in the second stylesheet, create a module headers-footers.style and move all the header and footer objects into it. You can then make both stylesheets modular and include the headers-footers.style module in both.
* 
When working with a modularized stylesheet, it is possible that two modules in a single stylesheet use different prefixes for the same namespace. This will have an effect on the order in which elements are listed in the Elements list. Since elements are displayed with the prefix for the namespace that applies in the module in which the element definition occurs, definitions for the same element may not be displayed adjacent to each other in the list. Their precedence relationship will be maintained, however.
Arbortext Styler overrides an entire definition. For example, for elements with the same name the entire element is overridden, not just included contexts or conditions.
The names of modules below the root module are displayed for individual elements and property sets in the Elements and Property Sets lists. The Arbortext Styler interface also contains precedence information for the elements and property sets. The name of the root module is displayed in the Arbortext Styler title bar. The Modules dialog box, available through File > Modules, enables you to control the module hierarchy. Other user interface components enable you to move or copy selected definitions to modules.
Validating Modularized Stylesheets
When working with modularized stylesheets, you should remember that if you are adding or deleting or modules this may invalidate every stylesheet that shares that module. It is good practice to validate any stylesheets that use those modules before production to confirm that any changes you have made have not had a negative effect. There are two ways in which you can validate a stylesheet:
1. Choose the Tools > Validate Stylesheet menu option in Arbortext Styler.
2. Carry out a preview action with the stylesheet, via the Preview menu. Arbortext Styler carries out an automatic stylesheet validation process whenever a preview action is selected.
If the publishing log displays errors such as that shown below, it may because the stylesheet has errors caused by missing modules or incorrect module references:
Fatal error encountered while running composition piepline