]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/help/C/xsl/tactic_quickref.xsl
Manual(s) fixed and committed to avoid rebuilding them in dune
[helm.git] / matita / 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     <xsl:variable name="tactic_id">
31       <xsl:value-of select="ancestor::sect1/@id" />
32     </xsl:variable>
33
34     <row>
35       <entry>
36        <xsl:choose>
37         <xsl:when test="position()=1">
38          <xsl:attribute name="id">grammar.<xsl:value-of select="$declarative"/>tactic</xsl:attribute>
39          <xsl:text disable-output-escaping='yes'>&amp;tactic;</xsl:text>
40         </xsl:when>
41        </xsl:choose>
42       </entry>
43       <entry>
44        <xsl:choose>
45         <xsl:when test="position()=1">
46          <xsl:text>::=</xsl:text>
47         </xsl:when>
48         <xsl:otherwise>
49          <xsl:text>|</xsl:text>
50         </xsl:otherwise>
51        </xsl:choose>
52       </entry>
53       <entry>
54         <xsl:for-each select="listitem/para/* | listitem/para/child::text()">
55           <xsl:choose>
56
57             <xsl:when test="string(.) = $tactic">
58               <xsl:element name="link">
59                 <xsl:attribute name="linkend">
60                   <xsl:value-of select="$tactic_id" />
61                 </xsl:attribute>
62                 <xsl:copy-of select="." />
63               </xsl:element>
64             </xsl:when>
65
66             <xsl:otherwise>
67               <xsl:copy-of select="." />
68             </xsl:otherwise>
69
70           </xsl:choose>
71         </xsl:for-each>
72       </entry>
73     </row>
74
75   </xsl:template>
76
77 </xsl:stylesheet>