Customization best practices

Post here questions and problems related to oXygen frameworks/document types.
f11
Posts: 2
Joined: Sun May 12, 2013 7:13 pm

Customization best practices

Post 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
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Customization best practices

Post 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
Post Reply