#1237 Customizing user.footer.content removes main.js script

output: webhelp
XSL (1066)

I added some footer content to my webhelp HTML pages. When I added an override template for user.footer.content I found that the JavaScript for my pages stopped working correctly. The default XSLT file for webhelp uses the user.footer.content template to import the common/main.js JavaScript file. Overriding it removed that import.

I fixed the problem by moving the script import to the start of the <body> element. I found that it didn't work if I imported the script in the <head> element with the other JavaScript. I'm not sure why. This works though and it doesn't interfere with user.footer.content:

<xsl:attribute name="onLoad">
<xsl:call-template name="body.attributes"/>
<script type="text/javascript" src="common/main.js">
<div id="content" role="main">

I'm using docbook-xsl-ns-1.76.1 with DocBook 5.0. My processor is Saxon 6.5.5.


  • Peter Desjardins

  • Peter Desjardins

    • labels: --> XSL
    • priority: 5 --> 7
  • Peter Desjardins

    The attached file is the one I modified for my own testing. If no one objects to the change, I can make it.

  • Kasun Gajasinghe

    The template user.webhelp.content.footer can be used to over-ride footer content. It's empty by default. The reason here is that webhelp already uses the user over-rides provided by (X)HTML stylesheets. So, we have added empty templates like the above to let the users over-ride things easily.

    Anyway, your usecase makes sense. I don't think of any reason why we shouldn't if it just works at the start of the <body> element.


Log in to post a comment.