Thank you! I will try this out.
On 18/09/2013, at 4:03 AM, Bob Stayton b...@sagehill.net wrote:
What a great idea. That looks to be very useful for a variety of purposes.
Bob Stayton
Sagehill Enterprises
b...@sagehill.net
--
From: Jirka Kosek ji...@kosek.cz
Sent: Tuesday, September 17, 2013 2:33 AM
To: docbook-apps@lists.oasis-open.org
Subject: Re: [docbook-apps] Convert a relative file link to a URL in docbook
On Mon, Sep 16, 2013, at 21:13, Natalie Kershaw wrote:
xsl:template match=d:link[@role='relative']
xsl:copy
xsl:attribute name=xlink:href
xsl:value-of select=concat('http://prefix/', @xlink:href)/
/xsl:attribute
/xsl:copy
xsl:apply-templates select=d:link/
/xsl:template
This seems to half-work in that it does prepend the prefix to the link
href, but then it does not convert the link element into FO.
Bob already described, why it doesn't work. However you can quite easily
use this approach. Use profiling stylesheets (ones starting with
profile-, eg. profile-docbook.xsl) and put your template into profile
mode. By default profile mode copies source document and you can change
this behaviour to do some changes in your source document, for example:
xsl:template match=d:link[@role='relative'] mode=profile
xsl:copy
xsl:copy-of select=@*/
xsl:attribute name=xlink:href
xsl:value-of select=concat('http://prefix/', @xlink:href)/
/xsl:attribute
xsl:apply-templates mode=profile/
/xsl:copy
/xsl:template
That should do the trick.
Jirka
--
--
Jirka Kosek e-mail: ji...@kosek.cz http://xmlguru.cz
--
Professional XML consulting and training services
DocBook customization, custom XSLT/XSL-FO document processing
--
OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 member
--
-
To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
-
To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
-
To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org