Page 1 of 1

Customization best practices

Posted: Sun May 12, 2013 7:21 pm
by f11
Hi,

I started to apply some customizations to the DocBook stylesheets that come with Oxygen XML.
I customized docbook_custom.xsl in frameworks/docbook/xsl/fo.

However I'd consider making changes to files that are part of the standard file set of a product to be a bad practice. How bad this is one can see when installing a new version of Oxygen XML over an existing (customized) installation: The old installation is completely erased (although a warning is given before that) and with that my customizations as well.

I wonder if it is possible to apply customizations in such a way that they are done outside of the standard product install.

I tried to move docbook_custom.xsl to an external directory and modify the imports in the file but this didn't work and I didn't have enough time to figure out why.

Do you have any tips on customization best practices without modifying the standard Oxygen file set?

Thanks.

Regards,
Florian

Re: Customization best practices

Posted: Mon May 13, 2013 11:44 am
by sorin_ristache
Hi,
f11 wrote:I wonder if it is possible to apply customizations in such a way that they are done outside of the standard product install.

I tried to move docbook_custom.xsl to an external directory and modify the imports in the file but this didn't work and I didn't have enough time to figure out why.
You found the solution yourself, and you should look into the errors. Are they transformation errors, or validation errors? If you post the errors here we will try to help you.

When you create the custom XSLT file outside the Oxygen install dir you have to adjust all the relative paths in the xsl:import and xsl:include elements so that they point to the correct locations. This is the main source of errors in a custom stylesheet. For example the relative paths in the href attributes of the following elements of [Oxygen-install-dir]/frameworks/docbook/xsl/fo/docbook_custom.xsl must be modified in the custom stylesheet so that they point to the stylesheets located in [Oxygen-install-dir]/frameworks/docbook/xsl/fo:

Code: Select all

    <xsl:import href="profile-docbook.xsl"/>
<xsl:import href="highlight.xsl"/>
<xsl:import href="../oxygen_custom.xsl"/>

Regards,
Sorin