]> matita.cs.unibo.it Git - helm.git/blob - helm/software/matita/help/C/xsl/tactic_quickref.xsl
improved coercions support:
[helm.git] / helm / software / matita / help / C / xsl / tactic_quickref.xsl
1 <xsl:stylesheet version="1.0"
2   xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
3
4   <xsl:output
5     method="xml"
6     indent="yes"
7     omit-xml-declaration="yes"
8     />
9
10   <xsl:template match="/">
11     <table frame="topbot" rowsep="0" colsep="0" role="grammar">
12       <title>tactics</title>
13       <tgroup cols="3">
14       <tbody>
15        <xsl:apply-templates select="//varlistentry[@role='tactic.synopsis']">
16          <xsl:sort select="ancestor::sect1/title" />
17        </xsl:apply-templates>
18       </tbody>
19      </tgroup>
20     </table>
21   </xsl:template>
22
23   <xsl:template match="varlistentry">
24
25     <xsl:variable name="tactic">
26       <xsl:value-of select="ancestor::sect1/title" />
27     </xsl:variable>
28
29     <row>
30       <entry>
31        <xsl:choose>
32         <xsl:when test="position()=1">
33          <xsl:attribute name="id">grammar.tactic</xsl:attribute>
34          <xsl:text disable-output-escaping='yes'>&amp;tactic;</xsl:text>
35         </xsl:when>
36        </xsl:choose>
37       </entry>
38       <entry>
39        <xsl:choose>
40         <xsl:when test="position()=1">
41          <xsl:text>::=</xsl:text>
42         </xsl:when>
43         <xsl:otherwise>
44          <xsl:text>|</xsl:text>
45         </xsl:otherwise>
46        </xsl:choose>
47       </entry>
48       <entry>
49         <xsl:for-each select="listitem/para/* | listitem/para/child::text()">
50           <xsl:choose>
51
52             <xsl:when test="string(.) = $tactic">
53               <xsl:element name="link">
54                 <xsl:attribute name="linkend">
55                   <xsl:text>tac_</xsl:text>
56                   <xsl:value-of select="$tactic" />
57                 </xsl:attribute>
58                 <xsl:copy-of select="." />
59               </xsl:element>
60             </xsl:when>
61
62             <xsl:otherwise>
63               <xsl:copy-of select="." />
64             </xsl:otherwise>
65
66           </xsl:choose>
67         </xsl:for-each>
68       </entry>
69     </row>
70
71   </xsl:template>
72
73 </xsl:stylesheet>