]> granicus.if.org Git - docbook-dsssl/commitdiff
Added support for coref
authorNorman Walsh <ndw@nwalsh.com>
Sat, 12 Apr 2003 20:55:09 +0000 (20:55 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Sat, 12 Apr 2003 20:55:09 +0000 (20:55 +0000)
xsl/fo/callout.xsl

index e6f9935a5bb1fe68bfe28135f41ec13084e85e11..6be86edaaafebba9bb66a0a516fbd656d5003566 100644 (file)
   </fo:inline>
 </xsl:template>
 
+<xsl:template match="coref">
+  <!-- tricky; this relies on the fact that we can process the "co" that's -->
+  <!-- "over there" as if it were "right here" -->
+
+  <xsl:variable name="co" select="key('id', @linkend)"/>
+  <xsl:choose>
+    <xsl:when test="not($co)">
+      <xsl:message>
+        <xsl:text>Error: coref link is broken: </xsl:text>
+        <xsl:value-of select="@linkend"/>
+      </xsl:message>
+    </xsl:when>
+    <xsl:when test="local-name($co) != 'co'">
+      <xsl:message>
+        <xsl:text>Error: coref doesn't point to a co: </xsl:text>
+        <xsl:value-of select="@linkend"/>
+      </xsl:message>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:apply-templates select="$co"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
 <xsl:template match="co" mode="callout-bug">
   <xsl:call-template name="callout-bug">
     <xsl:with-param name="conum">