Merge "Merge release-4-6 into master"
[alexxy/gromacs.git] / src / gromacs / selection / tests / refdata / referencedata.xsl
1 <?xml version="1.0"?>
2
3 <xsl:stylesheet version="1.0"
4     xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
5
6 <xsl:import href="common-referencedata.xsl"/>
7
8 <xsl:key name="SelectionName" match="ParsedSelections/ParsedSelection" use="@Name"/>
9
10 <xsl:template match="ParsedSelections">
11     <h2>Parsed Selections</h2>
12     <table border="1">
13         <tr>
14             <th/>
15             <th>Input</th>
16             <th>Name</th>
17             <th>Text</th>
18             <th>Dynamic</th>
19         </tr>
20         <xsl:for-each select="*">
21         <tr>
22             <td><xsl:value-of select="@Name"/></td>
23             <td><xsl:value-of select="String[@Name='Input']"/></td>
24             <td><xsl:value-of select="String[@Name='Name']"/></td>
25             <td><xsl:value-of select="String[@Name='Text']"/></td>
26             <td><xsl:value-of select="Bool[@Name='Dynamic']"/></td>
27         </tr>
28         </xsl:for-each>
29     </table>
30 </xsl:template>
31
32 <xsl:template match="CompiledSelections">
33     <h2>Compiled Selections</h2>
34     <xsl:apply-templates />
35 </xsl:template>
36
37 <xsl:template match="EvaluatedSelections">
38     <h2>Evaluated for <xsl:value-of select="@Name"/></h2>
39     <xsl:apply-templates />
40 </xsl:template>
41
42 <xsl:template match="Selection">
43     <h3><xsl:value-of select="@Name"/></h3>
44     <p>
45         Selection text:<br/>
46         <xsl:value-of select="key('SelectionName', @Name)/String[@Name='Text']"/>
47     </p>
48     <xsl:apply-templates />
49 </xsl:template>
50
51 <xsl:template match="Selection/Sequence[@Name='Atoms']">
52     <p>
53         Atoms:
54         <xsl:call-template name="SequenceAsHorizontalTable"/>
55     </p>
56 </xsl:template>
57
58 <xsl:template match="Selection/Sequence[@Name='Positions']">
59     <p>
60         Positions (count: <xsl:value-of select="Int[@Name='Length']"/>):
61         <table border="1">
62             <tr>
63                 <xsl:if test="Position/Sequence[@Name='Atoms']">
64                     <th>Atom count</th>
65                     <th>Atoms</th>
66                 </xsl:if>
67                 <xsl:if test="Position/Int[@Name='RefId']">
68                     <th>RefId</th>
69                     <th>MappedId</th>
70                 </xsl:if>
71                 <xsl:if test="Position/Vector[@Name='Coordinates']">
72                     <th>Coordinates</th>
73                 </xsl:if>
74                 <xsl:if test="Position/Real[@Name='Mass']">
75                     <th>Mass</th>
76                 </xsl:if>
77                 <xsl:if test="Position/Real[@Name='Charge']">
78                     <th>Charge</th>
79                 </xsl:if>
80             </tr>
81             <xsl:for-each select="Position">
82             <tr>
83                 <xsl:if test="Sequence[@Name='Atoms']">
84                     <td><xsl:value-of select="Sequence[@Name='Atoms']/Int[@Name='Length']"/></td>
85                     <td>
86                         <xsl:call-template name="SequenceAsCSV">
87                             <xsl:with-param name="root" select="Sequence[@Name='Atoms']"/>
88                         </xsl:call-template>
89                     </td>
90                 </xsl:if>
91                 <xsl:if test="Int[@Name='RefId']">
92                     <td><xsl:value-of select="Int[@Name='RefId']"/></td>
93                     <td><xsl:value-of select="Int[@Name='MappedId']"/></td>
94                 </xsl:if>
95                 <xsl:if test="Vector[@Name='Coordinates']">
96                     <td>
97                         <xsl:apply-templates select="Vector[@Name='Coordinates']"/>
98                     </td>
99                 </xsl:if>
100                 <xsl:if test="Real[@Name='Mass']">
101                     <td><xsl:value-of select="Real[@Name='Mass']"/></td>
102                 </xsl:if>
103                 <xsl:if test="Real[@Name='Charge']">
104                     <td><xsl:value-of select="Real[@Name='Charge']"/></td>
105                 </xsl:if>
106             </tr>
107             </xsl:for-each>
108         </table>
109     </p>
110 </xsl:template>
111
112 </xsl:stylesheet>