and (not($node/@xlink:type) or
$node/@xlink:type='simple')">
- <!-- Is it a local idref or a uri? -->
+ <!-- Is it a local idref? -->
<xsl:variable name="is.idref">
<xsl:choose>
<!-- if the href starts with # and does not contain an "(" -->
</xsl:choose>
</xsl:variable>
+ <!-- Is it an olink ? -->
+ <xsl:variable name="is.olink">
+ <xsl:choose>
+ <!-- If xlink:role="http://docbook.org/xlink/role/olink" -->
+ <!-- and if the href contains # -->
+ <xsl:when test="contains($xhref,'#') and
+ @xlink:role = $xolink.role">1</xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
<xsl:choose>
<xsl:when test="$is.idref = 1">
</xsl:choose>
</xsl:when>
+ <xsl:when test="$is.olink = 1">
+ <xsl:call-template name="olink">
+ <xsl:with-param name="content" select="$content"/>
+ </xsl:call-template>
+ </xsl:when>
+
<!-- otherwise it's a URI -->
<xsl:otherwise>
<fo:basic-link external-destination="url({$xhref})">
******************************************************************** -->
+<!-- Use internal variable for olink xlink role for consistency -->
+<xsl:variable
+ name="xolink.role">http://docbook.org/xlink/role/olink</xsl:variable>
+
<!-- ==================================================================== -->
<xsl:template match="anchor">
</xsl:template>
<xsl:template match="olink" name="olink">
+ <!-- olink content may be passed in from xlink olink -->
+ <xsl:param name="content" select="NOTANELEMENT"/>
+
<xsl:call-template name="anchor"/>
<xsl:variable name="localinfo" select="@localinfo"/>
<xsl:choose>
<!-- olinks resolved by stylesheet and target database -->
- <xsl:when test="@targetdoc or @targetptr" >
- <xsl:variable name="targetdoc.att" select="@targetdoc"/>
- <xsl:variable name="targetptr.att" select="@targetptr"/>
+ <xsl:when test="@targetdoc or @targetptr or
+ (@xlink:role=$xolink.role and
+ contains(@xlink:href, '#') )" >
+
+ <xsl:variable name="targetdoc.att">
+ <xsl:choose>
+ <xsl:when test="@targetdoc != ''">
+ <xsl:value-of select="@targetdoc"/>
+ </xsl:when>
+ <xsl:when test="@xlink:role=$xolink.role and
+ contains(@xlink:href, '#')" >
+ <xsl:value-of select="substring-before(@xlink:href, '#')"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:variable name="targetptr.att">
+ <xsl:choose>
+ <xsl:when test="@targetptr != ''">
+ <xsl:value-of select="@targetptr"/>
+ </xsl:when>
+ <xsl:when test="@xlink:role=$xolink.role and
+ contains(@xlink:href, '#')" >
+ <xsl:value-of select="substring-after(@xlink:href, '#')"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:variable>
<xsl:variable name="olink.lang">
<xsl:call-template name="l10n.language">
</xsl:variable>
<xsl:variable name="hottext">
- <xsl:call-template name="olink.hottext">
- <xsl:with-param name="olink.key" select="$olink.key"/>
- <xsl:with-param name="olink.lang" select="$olink.lang"/>
- <xsl:with-param name="target.database" select="$target.database"/>
- </xsl:call-template>
+ <xsl:choose>
+ <xsl:when test="$content">
+ <xsl:copy-of select="$content"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="olink.hottext">
+ <xsl:with-param name="olink.key" select="$olink.key"/>
+ <xsl:with-param name="olink.lang" select="$olink.lang"/>
+ <xsl:with-param name="target.database" select="$target.database"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:variable>
<xsl:variable name="olink.docname.citation">
<xsl:param name="localinfo"/>
<xsl:param name="return" select="href"/>
- <xsl:message terminate="yes">Fatal error: what is this supposed to do?</xsl:message>
+ <xsl:message terminate="yes">Fatal error: olink.outline template: what is this supposed to do?</xsl:message>
</xsl:template>
<!-- ==================================================================== -->