1 f<?xml version="1.0"?> |
1 <?xml version="1.0"?> |
2 <xsl:stylesheet version="1.1" |
2 <xsl:stylesheet version="1.1" |
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
4 xmlns:xt="http://www.jclark.com/xt" |
4 xmlns:xt="http://www.jclark.com/xt" |
5 extension-element-prefixes="xt" |
5 extension-element-prefixes="xt" |
6 xmlns="http://www.w3.org/1999/XSL/Format"> |
6 xmlns="http://www.w3.org/1999/XSL/Format"> |
97 </xsl:call-template> |
97 </xsl:call-template> |
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 id="{$id}"/> |
102 <block> |
103 <xsl:apply-templates select="*[not(poetry)][name(.)!='poetry']"/> |
103 <xsl:if test="name(.) != 'poetry'"> |
104 <xsl:if test="section[poetry]"> |
104 <xsl:attribute name="id"><xsl:value-of select="$id"/></xsl:attribute> |
|
105 </xsl:if> |
|
106 <xsl:apply-templates select="*[not(poetry)][name(.)!='poetry']"/> |
|
107 <xsl:if test="section[poetry]"> |
105 <list-block text-indent="15mm" space-before="15pt"> |
108 <list-block text-indent="15mm" space-before="15pt"> |
106 <xsl:apply-templates select="section[poetry]" mode="toc"/> |
109 <xsl:apply-templates select="section[poetry]" mode="toc"/> |
107 </list-block> |
110 </list-block> |
108 </xsl:if> |
111 </xsl:if> |
|
112 </block> |
109 </flow> |
113 </flow> |
110 </page-sequence> |
114 </page-sequence> |
111 <xsl:apply-templates select="poetry|section[poetry]"/> |
115 <xsl:apply-templates select="poetry|section[poetry]"/> |
112 </xsl:template> |
116 </xsl:template> |
113 |
117 |
114 <xsl:template match="section|poetry" mode="toc"> |
118 <xsl:template match="section|poetry" mode="toc"> |
115 <list-item> |
119 <list-item> |
116 <xsl:call-template name="list-label"/> |
120 <xsl:call-template name="list-label"/> |
117 <list-item-body start-indent="body-start()"> |
121 <list-item-body start-indent="body-start()"> |
118 <xsl:apply-templates select="." mode="xref"/> |
122 <block> |
119 <!-- xsl:if test="poetry|section"> |
123 <xsl:apply-templates select="." mode="xref"/> |
120 <list-block |
124 </block> |
121 text-indent="body-start()" |
|
122 space-before="15pt"> |
|
123 <xsl:apply-templates select="poetry|section" mode="toc"/> |
|
124 </list-block> |
|
125 </xsl:if --> |
|
126 </list-item-body> |
125 </list-item-body> |
127 </list-item> |
126 </list-item> |
128 </xsl:template> |
127 </xsl:template> |
129 |
128 |
130 <xsl:template match="section"> |
129 <xsl:template match="section"> |
131 <xsl:variable name="id"> |
130 <xsl:apply-templates/> |
132 <xsl:call-template name="get-id"/> |
|
133 </xsl:variable> |
|
134 <block id="{$id}"> |
|
135 <xsl:apply-templates/> |
|
136 </block> |
|
137 </xsl:template> |
131 </xsl:template> |
138 |
132 |
139 <xsl:template match="preambule"> |
133 <xsl:template match="preambule"> |
140 <xsl:variable name="id"> |
134 <xsl:variable name="id"> |
141 <xsl:call-template name="get-id"/> |
135 <xsl:call-template name="get-id"/> |
241 |
235 |
242 <xsl:template match="poetry|section" mode="xref"> |
236 <xsl:template match="poetry|section" mode="xref"> |
243 <xsl:variable name="id"> |
237 <xsl:variable name="id"> |
244 <xsl:call-template name="get-id"/> |
238 <xsl:call-template name="get-id"/> |
245 </xsl:variable> |
239 </xsl:variable> |
246 <basic-link internal-destination="{$id}"> |
240 <basic-link internal-destination="{$id}"> |
247 <xsl:value-of select="descendant::title[1]"/> |
241 <xsl:value-of select="descendant::title[1]"/> |
248 <leader leader-pattern="dots" leader-length.maximum="254mm"/> |
242 <leader leader-pattern="dots" leader-length.maximum="254mm"/> |
249 (<page-number-citation ref-id="{$id}"/>) |
243 (<page-number-citation ref-id="{$id}"/>) |
250 </basic-link> |
244 </basic-link> |
251 </xsl:template> |
245 </xsl:template> |
252 |
246 |
253 <xsl:template match="xref"> |
247 <xsl:template match="xref"> |
254 <xsl:variable name="linkend" select="@linkend"/> |
248 <xsl:variable name="linkend" select="@linkend"/> |
255 <xsl:apply-templates mode="xref" select="//*[@id=$linkend]"/> |
249 <xsl:apply-templates mode="xref" select="//*[@id=$linkend]"/> |