Fix bad section id in poetry_print. styles
authorFabien Ninoles <fabien@tzone.org>
Sat, 05 Feb 2011 13:26:50 -0500
branchstyles
changeset 11 e2d28bf2a3bb
parent 10 5bba8548413e
child 14 6b2069bde265
child 15 27a2a404231e
Fix bad section id in poetry_print.
poetry_print.xsl
--- a/poetry_print.xsl	Sat Feb 05 12:36:46 2011 -0500
+++ b/poetry_print.xsl	Sat Feb 05 13:26:50 2011 -0500
@@ -1,4 +1,4 @@
-f<?xml version="1.0"?>
+<?xml version="1.0"?>
 <xsl:stylesheet version="1.1"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns:xt="http://www.jclark.com/xt"
@@ -99,13 +99,17 @@
       <xsl:call-template name="get-id"/>
     </xsl:variable>
     <flow flow-name="xsl-region-body">
-      <block id="{$id}"/>
-      <xsl:apply-templates select="*[not(poetry)][name(.)!='poetry']"/>
-      <xsl:if test="section[poetry]">
+      <block>
+	<xsl:if test="name(.) != 'poetry'">
+	  <xsl:attribute name="id"><xsl:value-of select="$id"/></xsl:attribute>
+	</xsl:if>
+	<xsl:apply-templates select="*[not(poetry)][name(.)!='poetry']"/>
+	<xsl:if test="section[poetry]">
 	<list-block text-indent="15mm" space-before="15pt">
 	  <xsl:apply-templates select="section[poetry]" mode="toc"/>
 	</list-block>
       </xsl:if>
+      </block>
     </flow>    
   </page-sequence>
   <xsl:apply-templates select="poetry|section[poetry]"/> 
@@ -115,25 +119,15 @@
   <list-item>
     <xsl:call-template name="list-label"/>
     <list-item-body start-indent="body-start()">
-      <xsl:apply-templates select="." mode="xref"/>
-      <!-- xsl:if test="poetry|section">
-	<list-block 
-	    text-indent="body-start()"
-	    space-before="15pt">
-	  <xsl:apply-templates select="poetry|section" mode="toc"/>
-	</list-block>
-      </xsl:if -->
+      <block>
+	<xsl:apply-templates select="." mode="xref"/>
+      </block>
     </list-item-body>
   </list-item>
 </xsl:template>
 
 <xsl:template match="section">
-  <xsl:variable name="id">
-    <xsl:call-template name="get-id"/>
-  </xsl:variable>
-  <block id="{$id}">
-    <xsl:apply-templates/>
-  </block>
+  <xsl:apply-templates/>
 </xsl:template>
 
 <xsl:template match="preambule">
@@ -243,11 +237,11 @@
   <xsl:variable name="id">
     <xsl:call-template name="get-id"/>
   </xsl:variable>
-  <basic-link internal-destination="{$id}">
-    <xsl:value-of select="descendant::title[1]"/>
-    <leader leader-pattern="dots" leader-length.maximum="254mm"/>
-    (<page-number-citation ref-id="{$id}"/>)
-  </basic-link>
+    <basic-link internal-destination="{$id}">
+      <xsl:value-of select="descendant::title[1]"/>
+      <leader leader-pattern="dots" leader-length.maximum="254mm"/>
+      (<page-number-citation ref-id="{$id}"/>)
+    </basic-link>
 </xsl:template>
 
 <xsl:template match="xref">