]> matita.cs.unibo.it Git - helm.git/blob - matita/help/C/xsl/tactic_quickref.xsl
tagged 0.5.0-rc1
[helm.git] / 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:param name="declarative" value=""/>
11
12   <xsl:template match="/">
13     <table frame="topbot" rowsep="0" colsep="0" role="grammar">
14       <title>tactics</title>
15       <tgroup cols="3">
16       <tbody>
17        <xsl:apply-templates select="//chapter[@id=concat('sec_',$declarative,'tactics')]//varlistentry[@role='tactic.synopsis']">
18          <xsl:sort select="ancestor::sect1/title" />
19        </xsl:apply-templates>
20       </tbody>
21      </tgroup>
22     </table>
23   </xsl:template>
24
25   <xsl:template match="varlistentry">
26
27     <xsl:variable name="tactic">
28       <xsl:value-of select="ancestor::sect1/title" />
29     </xsl:variable>
30
31     <row>
32       <entry>
33        <xsl:choose>
34         <xsl:when test="position()=1">
35          <xsl:attribute name="id">grammar.<xsl:value-of select="$declarative"/>tactic</xsl:attribute>
36          <xsl:text disable-output-escaping='yes'>&amp;tactic;</xsl:text>
37         </xsl:when>
38        </xsl:choose>
39       </entry>
40       <entry>
41        <xsl:choose>
42         <xsl:when test="position()=1">
43          <xsl:text>::=</xsl:text>
44         </xsl:when>
45         <xsl:otherwise>
46          <xsl:text>|</xsl:text>
47         </xsl:otherwise>
48        </xsl:choose>
49       </entry>
50       <entry>
51         <xsl:for-each select="listitem/para/* | listitem/para/child::text()">
52           <xsl:choose>
53
54             <xsl:when test="string(.) = $tactic">
55               <xsl:element name="link">
56                 <xsl:attribute name="linkend">
57                   <xsl:text>tac_</xsl:text>
58                   <xsl:value-of select="$tactic" />
59                 </xsl:attribute>
60                 <xsl:copy-of select="." />
61               </xsl:element>
62             </xsl:when>
63
64             <xsl:otherwise>
65               <xsl:copy-of select="." />
66             </xsl:otherwise>
67
68           </xsl:choose>
69         </xsl:for-each>
70       </entry>
71     </row>
72
73   </xsl:template>
74
75 </xsl:stylesheet>