]> granicus.if.org Git - docbook-dsssl/commitdiff
Bug #418100: fix qandaentry anchors; also fixed formatting bug in questions with...
authorNorman Walsh <ndw@nwalsh.com>
Tue, 24 Apr 2001 10:58:13 +0000 (10:58 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Tue, 24 Apr 2001 10:58:13 +0000 (10:58 +0000)
xsl/html/qandaset.xsl

index d181f33398c9927621a22a3c80546e0d81b49590..84c318a13e4c124549f10269f3e204e6c4b13489 100644 (file)
     <xsl:attribute name="class">
       <xsl:value-of select="name(.)"/>
     </xsl:attribute>
-    <a name="{$id}">
-      <xsl:apply-templates select="parent::qandadiv" mode="label.markup"/>
-      <xsl:text> </xsl:text>
-      <xsl:apply-templates/>
-    </a>
+    <a name="{$id}"/>
+    <xsl:apply-templates select="parent::qandadiv" mode="label.markup"/>
+    <xsl:text> </xsl:text>
+    <xsl:apply-templates/>
   </xsl:element>
 </xsl:template>
 
 </xsl:template>
 
 <xsl:template match="question">
-  <xsl:variable name="firstch" select="(*[name(.)!='label'])[1]"/>
-  <xsl:variable name="restch" select="(*[name(.)!='label'])[position()!=1]"/>
+  <xsl:variable name="firstch" select="(*[name(.)!='label'
+                                          and name(.)!='indexterm'])[1]"/>
+  <xsl:variable name="restch" select="(*[name(.)!='label'
+                                         and name(.)!='indexterm'])[position()!=1]
+                                      |indexterm"/>
   <xsl:variable name="id">
     <xsl:call-template name="object.id"/>
   </xsl:variable>
 
   <div class="{name(.)}">
     <p>
+      <xsl:if test="../@id">
+        <a>
+          <xsl:attribute name="name">
+            <xsl:call-template name="object.id">
+              <xsl:with-param name="object" select="parent::*"/>
+            </xsl:call-template>
+          </xsl:attribute>
+        </a>
+      </xsl:if>
       <a name="{$id}"/>
       <b>
         <xsl:apply-templates select="." mode="label.markup"/>