Subject: Re: [docbook-apps] Convert a relative file link to a URL in docbook
Yes, that is the hazard of customizing one of the templates.
If you are willing to add an extra step to your processing, you can run the file through an identity stylesheet that leaves everything the same except the xlink:href attribute for those links. Then you could apply the regular stylesheet to format it.
If you want to do it all within your customization, then this should work:
<xsl:template match="link[@role = 'relative']">
<xsl:value-of select="concat('http://prefix/', @xlink:href)"/>
This puts the modified copy of the element into a fake element, and saves the result tree fragment to a variable. Then it converts the fragment to a node-set using the exsl:node-set() function, and then selects the modified link element to apply-templates to. The fake element is needed to avoid processing the root of the temporary node set. In DocBook XSL, the root element is handled in a special way to set up an FO document with page-masters, and you want to avoid that by *not* processing the root element. That's the tricky part I was referring to earlier.
Thanks for the prompt reply. Yes I had thought of that solution, but it does not seem very maintainable. If that template changes when the library is upgraded, my customization layer will mean that I don't see those changes.
On Tue, Sep 17, 2013 at 7:48 AM, Bob Stayton <email@example.com> wrote: