98 <xsl:variable name="id"> |
98 <xsl:variable name="id"> |
99 <xsl:call-template name="get-id"/> |
99 <xsl:call-template name="get-id"/> |
100 </xsl:variable> |
100 </xsl:variable> |
101 <flow flow-name="xsl-region-body"> |
101 <flow flow-name="xsl-region-body"> |
102 <block> |
102 <block> |
103 <xsl:if test="name(.) != 'poetry'"> |
103 <xsl:if test="name(.) != 'poetry'"> |
104 <xsl:attribute name="id"><xsl:value-of select="$id"/></xsl:attribute> |
104 <xsl:attribute name="id"><xsl:value-of select="$id"/></xsl:attribute> |
105 </xsl:if> |
105 </xsl:if> |
106 <xsl:apply-templates select="*[not(poetry)][name(.)!='poetry']"/> |
106 <xsl:apply-templates select="*[not(poetry)][name(.)!='poetry']"/> |
107 <xsl:if test="section[poetry]"> |
107 <xsl:if test="section[poetry]"> |
108 <list-block text-indent="15mm" space-before="15pt"> |
108 <list-block text-indent="15mm" space-before="15pt"> |
109 <xsl:apply-templates select="section[poetry]" mode="toc"/> |
109 <xsl:apply-templates select="section[poetry]" mode="toc"/> |
110 </list-block> |
110 </list-block> |
111 </xsl:if> |
111 </xsl:if> |
112 </block> |
112 </block> |
113 </flow> |
113 </flow> |
114 </page-sequence> |
114 </page-sequence> |
115 <xsl:apply-templates select="poetry|section[poetry]"/> |
115 <xsl:apply-templates select="poetry|section[poetry]"/> |
116 </xsl:template> |
116 </xsl:template> |
231 </xsl:template> |
231 </xsl:template> |
232 <xsl:template match="cue/para"> |
232 <xsl:template match="cue/para"> |
233 <xsl:apply-templates/> |
233 <xsl:apply-templates/> |
234 </xsl:template> |
234 </xsl:template> |
235 |
235 |
236 <xsl:template match="poetry|section" mode="xref"> |
236 <xsl:template match="poetry|section" mode="toc-xref"> |
237 <xsl:variable name="id"> |
237 <xsl:variable name="id"> |
238 <xsl:call-template name="get-id"/> |
238 <xsl:call-template name="get-id"/> |
239 </xsl:variable> |
239 </xsl:variable> |
240 <basic-link internal-destination="{$id}"> |
240 <basic-link internal-destination="{$id}"> |
241 <xsl:value-of select="descendant::title[1]"/> |
241 <xsl:value-of select="descendant::title[1]"/> |
242 <leader leader-pattern="dots" leader-length.maximum="254mm"/> |
242 <leader leader-pattern="dots" leader-length.maximum="254mm"/> |
243 (<page-number-citation ref-id="{$id}"/>) |
243 (<page-number-citation ref-id="{$id}"/>) |
244 </basic-link> |
244 </basic-link> |
245 </xsl:template> |
245 </xsl:template> |
246 |
246 |
|
247 <xsl:template match="list[@role='toc']/item/xref"> |
|
248 <xsl:variable name="linkend" select="@linkend"/> |
|
249 <xsl:apply-templates mode="toc-xref" select="//*[@id=$linkend]"/> |
|
250 </xsl:template> |
|
251 |
247 <xsl:template match="xref"> |
252 <xsl:template match="xref"> |
248 <xsl:variable name="linkend" select="@linkend"/> |
253 <xsl:variable name="linkend" select="@linkend"/> |
249 <xsl:apply-templates mode="xref" select="//*[@id=$linkend]"/> |
254 <xsl:variable name="linkterm"> |
|
255 <xsl:choose> |
|
256 <xsl:when test="@linkterm"><xsl:value-of select="@linkterm"/></xsl:when> |
|
257 <xsl:otherwise><xsl:value-of select="@linkend"/></xsl:otherwise> |
|
258 </xsl:choose> |
|
259 </xsl:variable> |
|
260 <basic-link internal-destination="{$linkend}"> |
|
261 <xsl:apply-templates mode="xref" select="//*[@id=$linkterm]"/> |
|
262 </basic-link> |
|
263 </xsl:template> |
|
264 |
|
265 <xsl:template match="poetry|section" mode="xref"> |
|
266 <xsl:value-of select="descendant::title[1]"/> |
250 </xsl:template> |
267 </xsl:template> |
251 |
268 |
252 </xsl:stylesheet> |
269 </xsl:stylesheet> |
253 |
270 |