This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
Re: [docbook-apps] Re: How to include a JavaScript snippet into htmlhelp files?
On Wed, Oct 29, 2003 at 09:16:27PM +0100, W. Borgert wrote:
> Quoting Bob Stayton <bobs@sco.com>:
>
> > On Wed, Oct 29, 2003 at 07:40:54PM +0100, W. Borgert wrote:
>
> > As you discovered, patching the stylesheets
> > is a maintenance headache. The stylesheets are
> > designed to be customized using a customization
> > layer that leaves the stock stylesheets intact.
> > This is described in:
> >
> > http://www.sagehill.net/docbookxsl/CustomMethods.html#CustomizationLayer
>
> Thanks, this is very useful information.
>
> > You can customize the template named 'user.head.content',
> > which is designed for including extra stuff in each
> > HTML <head> element. It is defined as empty in the
> > distribution, and it is called when each <head> element
> > is generated. So you can customize it as follows:
> >
> > <xsl:template name="user.head.content">
> > <xsl:copy-of select="document('myscriptfile.js',/)"/>
> > </xsl:template>
>
> Thanks again, however this customisation works not perfectly
> for me. The various html link elements are now below the
> user.head.content. Unfortunately I need them before the
> script - otherwise it just doesn't work. There should be a
> user.head.endcontent or whatever at the end of the html.head
> template before the </head> - I think that would help me.
>
> I didn't try out the copy-of document, but it's OK for me to
> have the JavaScript code inside of my XSL file.
>
> If you have an idea, how to get my JavaScript stuff below
> the various links (home, up, next, ...), that would be great!
Unfortunately, there isn't. The template named
'html.head' in html/chunk-common.xsl always puts
the <link> elements last, so that template would have
to be copied to your customization layer
and modified to change the order. That's a big
template, and runs the risk of being modified
in future releases, but that's the only way
I see to do it.
I'm not understanding why the order makes a difference,
though.
--
Bob Stayton 400 Encinal Street
Publications Architect Santa Cruz, CA 95060
Technical Publications voice: (831) 427-7796
The SCO Group fax: (831) 429-1887
email: bobs@sco.com
To unsubscribe from this list, send a post to docbook-apps-unsubscribe@lists.oasis-open.org, or visit http://www.oasis-open.org/mlmanage/.