Ticket #1166: boost-links-1.patch

File boost-links-1.patch, 1.2 KB (added by Daniel James, 14 years ago)

New implementation, which transforms the links in the boostbook to docbook stage. Currently only translates ulinks, not other links such as images.

  • tools/boostbook/xsl/docbook.xsl

    commit 8159d20d5672347473172208e5f8981e5a4b8872
    Author: Daniel James <daniel@bah.(none)>
    Date:   Sat Feb 7 22:33:30 2009 +0000
    
        Implement boost paths for ulinks.
    
    diff --git a/tools/boostbook/xsl/docbook.xsl b/tools/boostbook/xsl/docbook.xsl
    index 98b7d7f..f50064b 100644
    a b  
    183183  </xsl:template>
    184184
    185185  <!-- Linking -->
     186
     187  <xsl:template match="ulink">
     188    <xsl:copy>
     189      <xsl:copy-of select="@*"/>
     190      <xsl:attribute name="url">
     191        <xsl:choose>
     192          <xsl:when test="starts-with(@url, 'boost:/')">
     193            <xsl:value-of select="concat($boost.root, substring-after(@url, 'boost:'))"/>
     194          </xsl:when>
     195          <xsl:when test="starts-with(@url, 'boost:')">
     196            <xsl:value-of select="concat($boost.root, '/', substring-after(@url, 'boost:'))"/>
     197          </xsl:when>
     198          <xsl:otherwise>
     199            <xsl:value-of select="@url"/>
     200          </xsl:otherwise>
     201        </xsl:choose>
     202      </xsl:attribute>
     203      <xsl:apply-templates/>
     204    </xsl:copy>
     205  </xsl:template>
     206
    186207  <xsl:template name="internal-link">
    187208    <xsl:param name="to"/>
    188209    <xsl:param name="text"/>