diff --git a/ws/Docbook/CustomLayer/webhelp/hdmextensions.xsl b/ws/Docbook/CustomLayer/webhelp/hdmextensions.xsl index cacd6a82a3169a1736fe1e536ba5b305e3edf0eb..bd995d7337d0ced814609495feacd556e47d03e2 100644 --- a/ws/Docbook/CustomLayer/webhelp/hdmextensions.xsl +++ b/ws/Docbook/CustomLayer/webhelp/hdmextensions.xsl @@ -76,8 +76,13 @@ <xsl:call-template name="id.attribute"> <xsl:with-param name="conditional" select="0"/> </xsl:call-template> + <xsl:variable name="parentId" select="ancestor::d:part/@xml:id"/> + <p> + <img title="Exercise" alt="exercise" style="vertical-align: middle;" width="40em" src="common/images/yoga-exercise.svg"/> + <xsl:text> No. </xsl:text> + <xsl:value-of select="count(preceding::d:qandaset[ancestor::d:part/@xml:id = $parentId]) + 1"/> + </p> - <img title="Exercise" alt="exercise" style="vertical-align: middle;" width="40em" src="common/images/yoga-exercise.svg"/> <xsl:apply-templates select="$title"/> <xsl:if test="not($title)"> <!-- andhor is output on title if there is one --> @@ -85,7 +90,7 @@ <xsl:with-param name="conditional" select="0"/> </xsl:call-template> </xsl:if> - <xsl:if test="((contains($toc.params, 'toc') and $toc != '0') or $toc = '1') and not(ancestor::d:answer and not($qanda.nested.in.toc=0))"> + <xsl:if test="((contains($toc.params, 'toc') and $toc != '0') or $toc = '1') and not(ancestor::d:answer and not($qanda.nested.in.toc=0))"> <xsl:call-template name="process.qanda.toc"/> </xsl:if> <xsl:apply-templates select="$preamble"/> diff --git a/ws/Docbook/Preprocess/Xsl/docbook2docbook.xsl b/ws/Docbook/Preprocess/Xsl/docbook2docbook.xsl index 20d771c55702f03c61ae09a67fd96ab5a186435d..2b0bd9022f9dd1a0bf2d7f3af7da7564298153f6 100644 --- a/ws/Docbook/Preprocess/Xsl/docbook2docbook.xsl +++ b/ws/Docbook/Preprocess/Xsl/docbook2docbook.xsl @@ -43,15 +43,20 @@ <caption> <xsl:text>Exercises in </xsl:text> <emphasis> - <xsl:value-of select="db:info/db:title" /> + <xsl:value-of select="ancestor-or-self::db:part/db:title" /> </emphasis> </caption> <col width="25%" /> + <col width="2%" /> <col width="45%" /> - <col width="30%" /> + <col width="28%" /> <tr> - <th>Chapter</th> - <th>Exercise title / page</th> + <th rowspan="2">Chapter</th> + <th colspan="3">Exercise</th> + </tr> + <tr> + <th>No.</th> + <th>Title</th> <th>Status of completion</th> </tr> @@ -63,6 +68,9 @@ <xref linkend="{current-grouping-key()}"/> </td> </xsl:if> + <td style="text-align: right;"> + <xsl:apply-templates select="." mode="qandaNumber"/> + </td> <td> <xsl:apply-templates select="." mode="selectOwnOrInheritedTitle"/> </td> @@ -72,12 +80,20 @@ </xsl:for-each-group> </table> + <!-- Not really useful: + <xsl:apply-templates select="db:chapter[descendant::db:qandaset]" mode="genQuandaset"/> + --> </appendix> </xsl:if> </xsl:copy> </xsl:template> + <xsl:template match="db:qandaset" mode="qandaNumber"> + <xsl:variable name="parentId" select="ancestor::db:part/@xml:id"/> + <xsl:value-of select="count(preceding::db:qandaset[ancestor::db:part/@xml:id = $parentId]) + 1"/> + </xsl:template> + <xsl:template match="db:chapter" mode="genQuandaset"> <section xml:id="{@xml:id}_qanda">