]> granicus.if.org Git - docbook-dsssl/commitdiff
fix issue #52 add support for xrefs to inlines
authorbobstayton <bobs@sagehill.net>
Fri, 13 Jul 2018 14:15:45 +0000 (07:15 -0700)
committerbobstayton <bobs@sagehill.net>
Fri, 13 Jul 2018 14:59:55 +0000 (07:59 -0700)
xsl/common/entities.ent
xsl/fo/ebnf.xsl
xsl/fo/graphics.xsl
xsl/fo/inline.xsl
xsl/fo/math.xsl
xsl/fo/synop.xsl
xsl/html/inline.xsl

index 93f20807eccd118e18300937707566902ce9d080..d47a8c708c6825b20656420d400ec801387e0171 100644 (file)
                                 parent::d:sect5|parent::d:section|parent::d:setindex|parent::d:sidebar|
                                 parent::d:simplesect|parent::d:taskprerequisites|parent::d:taskrelated|
                                 parent::d:tasksummary|parent::d:warning|parent::d:topic">
+
+<!-- Entity used in xref-to for inline elements -->
+<!ENTITY inline.elements "d:abbrev | d:accel | d:acronym | d:application | d:author | d:citation | d:citebiblioid
+                | d:citetitle | d:classname | d:code | d:command | d:computeroutput | d:constant | d:database
+                | d:date | d:editor | d:email | d:emphasis | d:envar | d:errorcode | d:errorname | d:errortext
+                | d:errortype | d:exceptionname | d:filename | d:firstterm | d:foreignphrase | d:function
+                | d:glossterm | d:guibutton | d:guiicon | d:guilabel | d:guimenu | d:guimenuitem | d:guisubmenu
+                | d:hardware | d:initializer | d:inlineequation | d:inlinemediaobject | d:interfacename | d:jobtitle
+                | d:keycap | d:keycode | d:keycombo | d:keysym | d:literal | d:markup | d:menuchoice | d:methodname
+                | d:modifier | d:mousebutton | d:nonterminal | d:ooclass | d:ooexception | d:oointerface
+                | d:option | d:optional | d:org | d:orgname | d:package | d:parameter | d:person | d:personname
+                | d:phrase | d:productname | d:productnumber | d:prompt | d:property | d:quote | d:replaceable
+                | d:returnvalue | d:shortcut | d:symbol | d:systemitem | d:tag | d:termdef | d:token | d:trademark
+                | d:type | d:uri | d:userinput | d:varname | d:wordasword">
index 2ce534bafc907177c44254193f66f8e8c5e5c2d5..e85070b699754c05783e52fb648a10ea68b8140e 100644 (file)
@@ -228,6 +228,7 @@ to be incomplete. Don't forget to read the source, too :-)</para>
 
   <fo:basic-link internal-destination="{$href}"
                  xsl:use-attribute-sets="xref.properties">
+    <xsl:call-template name="anchor"/>
     <xsl:choose>
       <xsl:when test="*|text()">
         <xsl:apply-templates/>
index 3f21f4e45c7cb7c05c7409b2fcf0bd8677c9af9a..ccd9dbf84daf6485df925d8663718416d1501e6c 100644 (file)
 </xsl:template>
 
 <xsl:template match="d:inlinemediaobject">
-  <xsl:call-template name="select.mediaobject"/>
+  <fo:inline>
+    <xsl:call-template name="anchor"/>
+    <xsl:call-template name="select.mediaobject"/>
+  </fo:inline>
 </xsl:template>
 
 <!-- ==================================================================== -->
index 218e7f8fc4f6a1df3d69ac26e0fd0c653f24ab3d..927811c4620f5d01e61976f4d890b5731058f592 100644 (file)
   </xsl:param>
 
   <fo:inline font-family="{$sans.font.family}">
+    <xsl:call-template name="anchor"/>
     <xsl:choose>
       <xsl:when test="@dir">
         <fo:inline>
     </xsl:call-template>
   </xsl:param>
 
-  <xsl:choose>
-    <xsl:when test="@dir">
-      <fo:inline>
-        <xsl:attribute name="direction">
-          <xsl:choose>
-            <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
-            <xsl:otherwise>rtl</xsl:otherwise>
-          </xsl:choose>
-        </xsl:attribute>
+  <fo:inline>
+    <xsl:call-template name="anchor"/>
+    <xsl:choose>
+      <xsl:when test="@dir">
+        <fo:inline>
+          <xsl:attribute name="direction">
+            <xsl:choose>
+              <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
+              <xsl:otherwise>rtl</xsl:otherwise>
+            </xsl:choose>
+          </xsl:attribute>
+          <xsl:copy-of select="$contentwithlink"/>
+        </fo:inline>
+      </xsl:when>
+      <xsl:otherwise>
         <xsl:copy-of select="$contentwithlink"/>
-      </fo:inline>
-    </xsl:when>
-    <xsl:otherwise>
-      <xsl:copy-of select="$contentwithlink"/>
-    </xsl:otherwise>
-  </xsl:choose>
+      </xsl:otherwise>
+    </xsl:choose>
+  </fo:inline>
 </xsl:template>
 
 <xsl:template name="inline.monoseq">
   </xsl:param>
 
   <fo:inline font-weight="bold">
+    <xsl:call-template name="anchor"/>
     <xsl:if test="@dir">
       <xsl:attribute name="direction">
         <xsl:choose>
 <xsl:template match="d:author">
   <xsl:call-template name="simple.xlink">
     <xsl:with-param name="content">
-      <xsl:call-template name="person.name"/>
+      <fo:inline>
+        <xsl:call-template name="anchor"/>
+        <xsl:call-template name="person.name"/>
+      </fo:inline>
     </xsl:with-param>
   </xsl:call-template>
 </xsl:template>
 <xsl:template match="d:editor">
   <xsl:call-template name="simple.xlink">
     <xsl:with-param name="content">
-      <xsl:call-template name="person.name"/>
+      <fo:inline>
+        <xsl:call-template name="anchor"/>
+        <xsl:call-template name="person.name"/>
+      </fo:inline>
     </xsl:with-param>
   </xsl:call-template>
 </xsl:template>
 <xsl:template match="d:othercredit">
   <xsl:call-template name="simple.xlink">
     <xsl:with-param name="content">
-      <xsl:call-template name="person.name"/>
+      <fo:inline>
+        <xsl:call-template name="anchor"/>
+        <xsl:call-template name="person.name"/>
+      </fo:inline>
     </xsl:with-param>
   </xsl:call-template>
 </xsl:template>
 
 <xsl:template match="d:phrase">
   <fo:inline>
-    <xsl:call-template name="anchor"/>
     <xsl:call-template name="inline.charseq"/>
   </fo:inline>
 </xsl:template>
   </xsl:variable>
 
   <fo:inline>
-    <xsl:call-template name="anchor"/>
     <xsl:copy-of select="$content"/>
   </fo:inline>
 
 
 <xsl:template match="d:termdef">
   <fo:inline>
+    <xsl:call-template name="anchor"/>
     <xsl:call-template name="gentext.template">
       <xsl:with-param name="context" select="'termdef'"/>
       <xsl:with-param name="name" select="'prefix'"/>
       <xsl:otherwise>+</xsl:otherwise>
     </xsl:choose>
   </xsl:variable>
-  <xsl:for-each select="*">
-    <xsl:if test="position()>1"><xsl:value-of select="$joinchar"/></xsl:if>
-    <xsl:apply-templates select="."/>
-  </xsl:for-each>
+  <fo:inline>
+    <xsl:call-template name="anchor"/>
+    <xsl:for-each select="*">
+      <xsl:if test="position()>1"><xsl:value-of select="$joinchar"/></xsl:if>
+      <xsl:apply-templates select="."/>
+    </xsl:for-each>
+  </fo:inline>
 </xsl:template>
 
 <xsl:template match="d:uri">
 
 <xsl:template match="d:menuchoice">
   <xsl:variable name="shortcut" select="./d:shortcut"/>
-  <xsl:call-template name="process.menuchoice"/>
+  <fo:inline>
+    <xsl:call-template name="anchor"/>
+    <xsl:call-template name="process.menuchoice"/>
+  </fo:inline>
   <xsl:if test="$shortcut">
     <xsl:text> (</xsl:text>
     <xsl:apply-templates select="$shortcut"/>
 <!-- ==================================================================== -->
 
 <xsl:template match="d:person">
-  <xsl:apply-templates select="d:personname"/>
+  <fo:inline>
+    <xsl:call-template name="anchor"/>
+    <xsl:apply-templates select="d:personname"/>
+  </fo:inline>
 </xsl:template>
 
 <xsl:template match="d:personname">
   <xsl:call-template name="simple.xlink">
     <xsl:with-param name="content">
-      <xsl:call-template name="person.name"/>
+      <fo:inline>
+        <xsl:call-template name="anchor"/>
+        <xsl:call-template name="person.name"/>
+      </fo:inline>
     </xsl:with-param>
   </xsl:call-template>
 </xsl:template>
 <xsl:template match="d:jobtitle">
   <xsl:call-template name="simple.xlink">
     <xsl:with-param name="content">
-      <xsl:apply-templates/>
+      <fo:inline>
+        <xsl:call-template name="anchor"/>
+        <xsl:apply-templates/>
+      </fo:inline>
     </xsl:with-param>
   </xsl:call-template>
 </xsl:template>
        templates with different properties for different linking elements -->
 </xsl:template>
 
+<!-- ==================================================================== -->
+<!-- generate text for xrefs to inline elements -->
+<xsl:template match="&inline.elements;" mode="xref-to">
+  <xsl:apply-templates mode="no.anchor.mode"/>
+</xsl:template>
+
 </xsl:stylesheet>
 
index 2a621d693d6eb1c3aa3cc51a9ac789fe2a7e385b..fa547741e722782f7629f528b75b5c7cc6b9e6db 100644 (file)
      ******************************************************************** -->
 
 <xsl:template match="d:inlineequation">
-  <xsl:apply-templates/>
+  <fo:inline>
+    <xsl:call-template name="anchor"/>
+    <xsl:apply-templates/>
+  </fo:inline>
 </xsl:template>
 
 <xsl:template match="d:alt">
@@ -23,6 +26,7 @@
 
 <xsl:template match="d:mathphrase">
   <fo:inline>
+    <xsl:call-template name="anchor"/>
     <xsl:apply-templates/>
   </fo:inline>
 </xsl:template>
index a1795f60ec375ef1133a2d7d91924839ca8cb4e1..f63142562200c7c2bd2e61fc9496bf2e7663aeb2 100644 (file)
 </xsl:template>
 
 <!-- Used when not occurring as a child of classsynopsis -->
-<xsl:template match="d:ooclass|d:oointerface|d:ooexception">
-  <xsl:apply-templates/>
+<xsl:template match="d:ooclass|d:oointerface|d:ooexception|d:modifier|d:initializer">
+  <fo:inline>
+    <xsl:call-template name="anchor"/>
+    <xsl:apply-templates/>
+  </fo:inline>
 </xsl:template>
 
 <!-- ==================================================================== -->
index ed876cf65e6c76745ffc0dab1cb2c26cc5b10e1c..36dd7347696da20801a53ae6cc3d95a3ceb1b010 100644 (file)
   <!-- does nothing; this *is not* markup to force a page break. -->
 </xsl:template>
 
+<!-- ==================================================================== -->
+<!-- generate text for xrefs to inline elements -->
+<xsl:template match="&inline.elements;" mode="xref-to">
+  <xsl:apply-templates mode="no.anchor.mode"/>
+</xsl:template>
+
 </xsl:stylesheet>