poetry_print.xsl
branchstyles
changeset 4 301b54644bfa
parent 3 6e7e05c2ded6
child 6 a59023633201
equal deleted inserted replaced
3:6e7e05c2ded6 4:301b54644bfa
    34             </table-body>
    34             </table-body>
    35           </table>
    35           </table>
    36         </block>
    36         </block>
    37       </static-content>
    37       </static-content>
    38       <static-content flow-name="xsl-region-after">
    38       <static-content flow-name="xsl-region-after">
    39         <block border-before-style="solid">
    39         <block space-before="10mm" border-before-style="solid">
    40           <table width="100%" table-layout="fixed">
    40           <table space-before="2mm" width="100%" table-layout="fixed">
    41             <table-column column-width="proportional-column-width(1)"
    41             <table-column column-width="proportional-column-width(1)"
    42                   number-columns-repeated="2"/>
    42                   number-columns-repeated="2"/>
    43             <table-body>
    43             <table-body>
    44               <table-row>
    44               <table-row>
    45                 <table-cell>
    45                 <table-cell>
    57 
    57 
    58 <!-- book -->
    58 <!-- book -->
    59 <xsl:template match="book">
    59 <xsl:template match="book">
    60   <root>
    60   <root>
    61     <xsl:call-template name="master-set"/>
    61     <xsl:call-template name="master-set"/>
    62     <xsl:apply-templates select="section"/>
    62     <page-sequence master-reference="book-sequence">
       
    63       <xsl:call-template name="static-content">
       
    64 	<xsl:with-param name="title">
       
    65 	  <xsl:apply-templates select="descendant::title[1]"/>
       
    66 	</xsl:with-param>
       
    67       </xsl:call-template>
       
    68       <xsl:variable name="id">
       
    69 	<xsl:call-template name="get-id"/>
       
    70       </xsl:variable>
       
    71       <flow flow-name="xsl-region-body">
       
    72 	<block id="{$id}"/>
       
    73 	<xsl:apply-templates select="*[name(.)!='section']"/>
       
    74       </flow>
       
    75     </page-sequence>
       
    76     <xsl:apply-templates select="section"/> 
    63   </root>
    77   </root>
    64 </xsl:template>
    78 </xsl:template>
    65 
    79 
    66 <xsl:template match="/book/section">
    80 <xsl:template 
       
    81     match="/book/section|section[poetry]|poetry|/book/addendum">
    67   <page-sequence master-reference="book-sequence">
    82   <page-sequence master-reference="book-sequence">
    68     <xsl:call-template name="static-content">
    83     <xsl:call-template name="static-content">
    69       <xsl:with-param name="title">
    84       <xsl:with-param name="title">
    70         <xsl:apply-templates select="title"/>
    85 	<xsl:choose>
       
    86 	  <xsl:when test="name(.)='preambule'">
       
    87 	    <xsl:text>Préambule</xsl:text>
       
    88 	  </xsl:when>
       
    89 	  <xsl:when test="name(.)='addendum'">
       
    90 	    <xsl:text>Addendum</xsl:text>
       
    91 	  </xsl:when>
       
    92 	  <xsl:otherwise>
       
    93 	    <xsl:apply-templates select="descendant::title[1]"/>
       
    94 	  </xsl:otherwise>
       
    95 	</xsl:choose>
    71       </xsl:with-param>
    96       </xsl:with-param>
    72     </xsl:call-template>
    97     </xsl:call-template>
       
    98     <xsl:variable name="id">
       
    99       <xsl:call-template name="get-id"/>
       
   100     </xsl:variable>
    73     <flow flow-name="xsl-region-body">
   101     <flow flow-name="xsl-region-body">
    74       <xsl:apply-templates select="*[name()!='poetry']"/>
   102       <block id="{$id}"/>
    75     </flow>
   103       <xsl:apply-templates select="*[not(poetry)][name(.)!='poetry']"/>
       
   104       <xsl:if test="section[poetry]">
       
   105 	<list-block text-indent="15mm" space-before="15pt">
       
   106 	  <xsl:apply-templates select="section[poetry]" mode="toc"/>
       
   107 	</list-block>
       
   108       </xsl:if>
       
   109     </flow>    
    76   </page-sequence>
   110   </page-sequence>
    77   <xsl:apply-templates select="poetry"/> 
   111   <xsl:apply-templates select="poetry|section[poetry]"/> 
    78 </xsl:template>
   112 </xsl:template>
    79 
   113 
    80 <xsl:template match="poetry">
   114 <xsl:template match="section|poetry" mode="toc">
    81   <page-sequence master-reference="book-sequence">
   115   <list-item>
    82     <xsl:call-template name="static-content">
   116     <xsl:call-template name="list-label"/>
    83       <xsl:with-param name="title">
   117     <list-item-body start-indent="body-start()">
    84         <xsl:apply-templates select="docinfo/title"/>
   118       <xsl:apply-templates select="." mode="xref"/>
    85       </xsl:with-param>
   119       <!-- xsl:if test="poetry|section">
    86     </xsl:call-template>
   120 	<list-block 
    87     <flow flow-name="xsl-region-body">
   121 	    text-indent="body-start()"
    88       <xsl:apply-templates/>
   122 	    space-before="15pt">
    89     </flow>
   123 	  <xsl:apply-templates select="poetry|section" mode="toc"/>
    90   </page-sequence>
   124 	</list-block>
    91 </xsl:template>
   125       </xsl:if -->
    92 
   126     </list-item-body>
    93 <xsl:template match="section/title">
   127   </list-item>
       
   128 </xsl:template>
       
   129 
       
   130 <xsl:template match="section">
       
   131   <xsl:variable name="id">
       
   132     <xsl:call-template name="get-id"/>
       
   133   </xsl:variable>
       
   134   <block id="{$id}">
       
   135     <xsl:apply-templates/>
       
   136   </block>
       
   137 </xsl:template>
       
   138 
       
   139 <xsl:template match="preambule">
       
   140   <xsl:variable name="id">
       
   141     <xsl:call-template name="get-id"/>
       
   142   </xsl:variable>
       
   143   <block id="{$id}">
       
   144     <xsl:if test="not(title)">
       
   145       <block xsl:use-attribute-sets="verylarge-title-font">
       
   146 	<xsl:attribute name="space-after">5pt</xsl:attribute>
       
   147 	<xsl:attribute name="space-before">10pt</xsl:attribute>
       
   148 	<xsl:text>Préambule</xsl:text>
       
   149       </block>
       
   150     </xsl:if>
       
   151     <xsl:apply-templates/>
       
   152   </block>
       
   153 </xsl:template>
       
   154 
       
   155 <xsl:template match="book/title|section/title|preambule/title">
    94   <block xsl:use-attribute-sets="verylarge-title-font">
   156   <block xsl:use-attribute-sets="verylarge-title-font">
    95     <xsl:attribute name="space-after">5pt</xsl:attribute>
   157     <xsl:attribute name="space-after">5pt</xsl:attribute>
    96     <xsl:attribute name="space-before">10pt</xsl:attribute>
   158     <xsl:attribute name="space-before">10pt</xsl:attribute>
    97     <xsl:apply-templates/>
   159     <xsl:apply-templates/>
    98   </block>
   160   </block>
   105     <xsl:apply-templates/>
   167     <xsl:apply-templates/>
   106   </block>
   168   </block>
   107 </xsl:template>
   169 </xsl:template>
   108 
   170 
   109 <xsl:template match="nda">
   171 <xsl:template match="nda">
   110   <block border-top="solid" border-bottom="solid"
   172   <block border="solid" padding="5mm"
   111     font-size="75%" font-style="italic"
   173     font-size="90%" font-style="italic"
   112     padding-top="10pt" padding-bottom="10pt"
   174     space-before="15mm" space-before.conditionnaly="discard"
   113     space-before="1in" space-before.conditionnaly="discard"
   175     space-after="15mm" space-after.conditionnaly="discard"
   114     margin-left=".5in" margin-right=".5in">
   176     margin="5mm">
   115     <xsl:apply-templates/>
   177     <xsl:apply-templates/>
   116   </block>
   178   </block>
   117 </xsl:template>
   179 </xsl:template>
   118 
   180 
   119 <xsl:template match="para">
   181 <xsl:template match="para">
   143   </block>
   205   </block>
   144 </xsl:template>
   206 </xsl:template>
   145 
   207 
   146 <xsl:template match="poem">
   208 <xsl:template match="poem">
   147   <block xsl:use-attribute-sets="standard-block">
   209   <block xsl:use-attribute-sets="standard-block">
   148     <xsl:attribute name="id">
       
   149       <xsl:value-of select="../@id"/>
       
   150     </xsl:attribute>
       
   151     <xsl:apply-templates/>
   210     <xsl:apply-templates/>
   152   </block>
   211   </block>
   153 </xsl:template>
   212 </xsl:template>
   154 
   213 
   155 <xsl:template match="strophe">
   214 <xsl:template match="strophe">
   175 </xsl:template>
   234 </xsl:template>
   176 <xsl:template match="cue/para">
   235 <xsl:template match="cue/para">
   177   <xsl:apply-templates/>
   236   <xsl:apply-templates/>
   178 </xsl:template>
   237 </xsl:template>
   179 
   238 
   180 <xsl:template match="poetry" mode="xref">
   239 <xsl:template match="poetry|section" mode="xref">
   181   <xsl:variable name="href">
   240   <xsl:variable name="id">
   182     <xsl:call-template name="get-id"/>
   241     <xsl:call-template name="get-id"/>
   183   </xsl:variable>
   242   </xsl:variable>
   184   <basic-link internal-destination="{$href}">
   243   <basic-link internal-destination="{$id}">
   185     <xsl:value-of select="docinfo/title"/>
   244     <xsl:value-of select="descendant::title[1]"/>
   186     (<page-number-citation ref-id="{$href}"/>)
   245     <leader leader-pattern="dots" leader-length.maximum="254mm"/>
       
   246     (<page-number-citation ref-id="{$id}"/>)
   187   </basic-link>
   247   </basic-link>
   188 </xsl:template>
   248 </xsl:template>
   189 
   249 
   190 <xsl:template match="xref">
   250 <xsl:template match="xref">
   191   <xsl:variable name="linkend" select="@linkend"/>
   251   <xsl:variable name="linkend" select="@linkend"/>