]> granicus.if.org Git - docbook-dsssl/commitdiff
Fix bug #1306 warn of nested links, since not supported in the output.
authorBob Stayton <bobs@sagehill.net>
Fri, 17 Jan 2014 23:26:40 +0000 (23:26 +0000)
committerBob Stayton <bobs@sagehill.net>
Fri, 17 Jan 2014 23:26:40 +0000 (23:26 +0000)
xsl/html/inline.xsl

index b032d455be2d4b3209675cd5a3bc4fbeeab8c823..2c1ce46d73e46de3cf4aebd8ddd597d34dda9d4e 100644 (file)
   <xsl:param name="linkend" select="$node/@linkend"/>
   <xsl:param name="xhref" select="$node/@xlink:href"/>
 
+  <!-- check for nested links, which are undefined in the output -->
+  <xsl:if test="$node/ancestor::*[@xlink:href or @linkend]">
+    <xsl:message>
+      <xsl:text>WARNING: nested link may be undefined in output: </xsl:text>
+      <xsl:text>&lt;</xsl:text>
+      <xsl:value-of select="name($node)"/>
+      <xsl:text> </xsl:text>
+      <xsl:choose>
+        <xsl:when test="$linkend">
+          <xsl:text>@linkend = '</xsl:text>
+          <xsl:value-of select="$linkend"/>
+          <xsl:text>'.</xsl:text>
+        </xsl:when>
+        <xsl:when test="$xhref">
+          <xsl:text>@xlink:href = '</xsl:text>
+          <xsl:value-of select="$xhref"/>
+          <xsl:text>'.</xsl:text>
+        </xsl:when>
+      </xsl:choose>
+    </xsl:message>
+  </xsl:if>
+
   <!-- Support for @xlink:show -->
   <xsl:variable name="target.show">
     <xsl:choose>