About Arbortext Styler > Extending Stylesheets > Editing Common XSL Source
Editing Common XSL Source
Arbortext Styler enables you to provide common XSL source in your stylesheet, where you write edits to the XSL code in a single location in the .style file. The source edits will then apply to all XSL outputs (XSL-FO, RTF, HTML File, Web, HTML Help, EPUB). Code that is common to XSL outputs is often of the “utility template” kind that isn’t necessarily related to any particular element or contexts. Such code would not be accessed unless referenced by some output-specific edited source for some context.
For example, if you need to call a certain named template from the XSL-HTML and XSL-Web sources, you can declare the template in the common XSL source, then call that template from the required sources.
To provide common XSL source:
1. Choose the Tools > Advanced Edited Source > Edit Common XSL Source.
2. In the Source Editor, make the changes required then apply those changes.
For example, you could add a declaration for a particular named template that all XSL source types may need to reference.
Common XSL code is included in the styler2xsl-exported XSL for all XSL outputs.
You can include most top level XSLT elements in common XSL source. It is expected that the most common construct will be a named template which could then be called from other edited source for any XSL output type. However, it may also be useful to include elements such as the following:
match templates
xsl:variable assignments
xsl:attribute-set definitions
You must ensure that neither of the situations listed below occurs when providing common XSL source:
No named template, variable, or attribute-set is given a name that is already used by the Arbortext Styler-generated XSLT.
No added match template can have the identical match attribute, mode, and priority as one generated by Arbortext Styler.
If such a conflict exists, you will see a warning and your publishing process will contain errors.