]> granicus.if.org Git - docbook-dsssl/commitdiff
Output anchors for list elements with IDs
authorNorman Walsh <ndw@nwalsh.com>
Wed, 1 Aug 2001 00:49:22 +0000 (00:49 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Wed, 1 Aug 2001 00:49:22 +0000 (00:49 +0000)
xsl/html/lists.xsl

index 8d840758cce058fcd8f4564751033cc74a313c1f..797c7e29d034bdfae28d58cd3a6acc3b0dd80d84 100644 (file)
@@ -16,6 +16,9 @@
 
 <xsl:template match="itemizedlist">
   <div class="{name(.)}">
+    <xsl:if test="@id">
+      <a name="{@id}"/>
+    </xsl:if>
     <xsl:if test="title">
       <xsl:apply-templates select="title"/>
     </xsl:if>
@@ -88,6 +91,9 @@
     </xsl:choose>
   </xsl:variable>
   <div class="{name(.)}">
+    <xsl:if test="@id">
+      <a name="{@id}"/>
+    </xsl:if>
     <xsl:if test="title">
       <xsl:apply-templates select="title"/>
     </xsl:if>
 
 <xsl:template match="variablelist">
   <div class="{name(.)}">
+    <xsl:if test="@id">
+      <a name="{@id}"/>
+    </xsl:if>
     <xsl:if test="title">
       <xsl:apply-templates select="title"/>
     </xsl:if>
 </xsl:template>
 
 <xsl:template match="varlistentry/term">
-  <span class="term"><xsl:apply-templates/>, </span>
+  <span class="term">
+    <xsl:if test="@id">
+      <a name="{@id}"/>
+    </xsl:if>
+    <xsl:apply-templates/>
+    <xsl:text>, </xsl:text>
+  </span>
 </xsl:template>
 
 <xsl:template match="varlistentry/term[position()=last()]" priority="2">
-  <span class="term"><xsl:apply-templates/></span>
+  <span class="term">
+    <xsl:if test="@id">
+      <a name="{@id}"/>
+    </xsl:if>
+    <xsl:apply-templates/>
+  </span>
 </xsl:template>
 
 <xsl:template match="varlistentry/listitem">
   </xsl:choose>
 </xsl:template>
 
-
 <!-- ==================================================================== -->
 
 <xsl:template match="simplelist">
   <!-- with no type specified, the default is 'vert' -->
+  <xsl:if test="@id">
+    <a name="{@id}"/>
+  </xsl:if>
   <table class="simplelist" border="0" summary="Simple list">
     <xsl:call-template name="simplelist.vert">
       <xsl:with-param name="cols">
 </xsl:template>
 
 <xsl:template match="simplelist[@type='inline']">
-  <span class="{name(.)}"><xsl:apply-templates/></span>
+  <span class="{name(.)}">
+    <xsl:if test="@id">
+      <a name="{@id}"/>
+    </xsl:if>
+    <xsl:apply-templates/>
+  </span>
 </xsl:template>
 
 <xsl:template match="simplelist[@type='horiz']">
+  <xsl:if test="@id">
+    <a name="{@id}"/>
+  </xsl:if>
   <table class="simplelist" border="0" summary="Simple list">
     <xsl:call-template name="simplelist.horiz">
       <xsl:with-param name="cols">
 </xsl:template>
 
 <xsl:template match="simplelist[@type='vert']">
+  <xsl:if test="@id">
+    <a name="{@id}"/>
+  </xsl:if>
   <table class="simplelist" border="0" summary="Simple list">
     <xsl:call-template name="simplelist.vert">
       <xsl:with-param name="cols">
 
 <xsl:template match="procedure">
   <div class="{name(.)}">
+    <xsl:if test="@id">
+      <a name="{@id}"/>
+    </xsl:if>
     <xsl:if test="title or $formal.procedures != 0">
       <xsl:call-template name="formal.object.heading"/>
     </xsl:if>
     <xsl:call-template name="procedure.step.numeration"/>
   </xsl:variable>
 
+  <xsl:if test="@id">
+    <a name="{@id}"/>
+  </xsl:if>
+
   <ol type="{$numeration}">
     <xsl:apply-templates/>
   </ol>
 <!-- ==================================================================== -->
 
 <xsl:template match="segmentedlist">
+  <xsl:if test="@id">
+    <a name="{@id}"/>
+  </xsl:if>
   <xsl:apply-templates/>
 </xsl:template>