]> matita.cs.unibo.it Git - helm.git/blob - matita/help/C/xsl/tactic_quickref.xsl
added generation of quick reference card of tactic syntax
[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:template match="/">
11     <itemizedlist>
12       <xsl:apply-templates select="//varlistentry[@role='tactic.synopsis']">
13         <xsl:sort select="ancestor::sect1/title" />
14       </xsl:apply-templates>
15     </itemizedlist>
16   </xsl:template>
17
18   <xsl:template match="varlistentry">
19
20     <xsl:variable name="tactic">
21       <xsl:value-of select="ancestor::sect1/title" />
22     </xsl:variable>
23
24     <listitem>
25       <para>
26         <xsl:for-each select="listitem/para/* | listitem/para/child::text()">
27           <xsl:choose>
28
29             <xsl:when test="string(.) = $tactic">
30               <xsl:element name="link">
31                 <xsl:attribute name="linkend">
32                   <xsl:text>tac_</xsl:text>
33                   <xsl:value-of select="$tactic" />
34                 </xsl:attribute>
35                 <xsl:copy-of select="." />
36               </xsl:element>
37             </xsl:when>
38
39             <xsl:otherwise>
40               <xsl:copy-of select="." />
41             </xsl:otherwise>
42
43           </xsl:choose>
44         </xsl:for-each>
45       </para>
46     </listitem>
47
48   </xsl:template>
49
50 </xsl:stylesheet>