Merge branch release-5-1
[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 <!-- Index handling reference data -->
9
10 <xsl:template match="BlockAtoms">
11     <xsl:if test="Sequence[@Name='Input']">
12         <h2>Input Atoms</h2>
13         <xsl:call-template name="SequenceAsHorizontalTable">
14             <xsl:with-param name="root" select="Sequence[@Name='Input']"/>
15         </xsl:call-template>
16     </xsl:if>
17     <h2>Blocks</h2>
18     <table border="1">
19         <tr>
20             <th>Atom count</th>
21             <th>Atoms</th>
22         </tr>
23         <xsl:for-each select="Block">
24             <tr>
25                 <td><xsl:value-of select="Sequence[@Name='Atoms']/Int[@Name='Length']"/></td>
26                 <td>
27                     <xsl:call-template name="SequenceAsCSV">
28                         <xsl:with-param name="root" select="Sequence[@Name='Atoms']"/>
29                     </xsl:call-template>
30                 </td>
31             </tr>
32         </xsl:for-each>
33     </table>
34 </xsl:template>
35
36 <xsl:template match="IndexMapping">
37     <h2><xsl:value-of select="@Name"/></h2>
38     <h3>Input Atoms</h3>
39     <xsl:call-template name="SequenceAsHorizontalTable">
40         <xsl:with-param name="root" select="Sequence[@Name='Input']"/>
41     </xsl:call-template>
42     <h3>Mapping</h3>
43     <table border="1">
44         <tr>
45             <th>RefId</th>
46             <xsl:if test="Block/Int[@Name='MapId']">
47                 <th>MapId</th>
48             </xsl:if>
49             <th>Atom count</th>
50             <th>Atoms</th>
51         </tr>
52         <xsl:for-each select="Block">
53             <tr>
54                 <td><xsl:value-of select="Int[@Name='RefId']"/></td>
55                 <xsl:if test="Int[@Name='MapId']">
56                     <td><xsl:value-of select="Int[@Name='MapId']"/></td>
57                 </xsl:if>
58                 <td><xsl:value-of select="Sequence[@Name='Atoms']/Int[@Name='Length']"/></td>
59                 <td>
60                     <xsl:call-template name="SequenceAsCSV">
61                         <xsl:with-param name="root" select="Sequence[@Name='Atoms']"/>
62                     </xsl:call-template>
63                 </td>
64             </tr>
65         </xsl:for-each>
66     </table>
67 </xsl:template>
68
69 <xsl:template match="OrgIdGroups">
70     <h2>Groups: <xsl:value-of select="@Name"/></h2>
71     <table>
72         <tr>
73             <td>Group count:</td>
74             <td><xsl:value-of select="Int[@Name='GroupCount']"/></td>
75         </tr>
76         <tr>
77             <td>OrgId</td>
78             <td>
79                 <xsl:call-template name="SequenceAsCSV">
80                     <xsl:with-param name="root" select="Sequence[@Name='OrgId']"/>
81                 </xsl:call-template>
82             </td>
83         </tr>
84     </table>
85 </xsl:template>
86
87 <!-- Position calculation reference data -->
88
89 <xsl:template match="InitializedPositions">
90     <h2>Initialized Positions</h2>
91     <xsl:apply-templates />
92 </xsl:template>
93
94 <xsl:template match="EvaluatedPositions">
95     <h2>Evaluated for <xsl:value-of select="@Name"/></h2>
96     <xsl:apply-templates />
97 </xsl:template>
98
99 <xsl:template match="Positions">
100     <xsl:if test="@Name">
101         <h3><xsl:value-of select="@Name"/></h3>
102     </xsl:if>
103     <table>
104         <tr>
105             <td>Count:</td>
106             <td>
107                 <xsl:value-of select="Int[@Name='Count']"/>
108                 (type: <xsl:value-of select="String[@Name='Type']"/>)
109             </td>
110         </tr>
111         <tr>
112             <td>Blocks:</td>
113             <td>
114                 <xsl:call-template name="SequenceAsCSV">
115                     <xsl:with-param name="root" select="Sequence[@Name='Block']"/>
116                 </xsl:call-template>
117             </td>
118         </tr>
119     </table>
120     <table border="1">
121         <tr>
122             <th>RefId</th>
123             <th>Atom count</th>
124             <th>Atoms</th>
125             <xsl:if test="Position/Vector[@Name='Coordinates']">
126                 <th>Coordinates</th>
127             </xsl:if>
128             <xsl:if test="Position/Vector[@Name='Velocity']">
129                 <th>Velocity</th>
130             </xsl:if>
131             <xsl:if test="Position/Vector[@Name='Force']">
132                 <th>Force</th>
133             </xsl:if>
134         </tr>
135         <xsl:for-each select="Position">
136             <tr>
137                 <td><xsl:value-of select="Int[@Name='RefId']"/></td>
138                 <td><xsl:value-of select="Sequence[@Name='Atoms']/Int[@Name='Length']"/></td>
139                 <td>
140                     <xsl:call-template name="SequenceAsCSV">
141                         <xsl:with-param name="root" select="Sequence[@Name='Atoms']"/>
142                     </xsl:call-template>
143                 </td>
144                 <xsl:if test="Vector[@Name='Coordinates']">
145                     <td>
146                         <xsl:apply-templates select="Vector[@Name='Coordinates']"/>
147                     </td>
148                 </xsl:if>
149                 <xsl:if test="Vector[@Name='Velocity']">
150                     <td>
151                         <xsl:apply-templates select="Vector[@Name='Velocity']"/>
152                     </td>
153                 </xsl:if>
154                 <xsl:if test="Vector[@Name='Force']">
155                     <td>
156                         <xsl:apply-templates select="Vector[@Name='Force']"/>
157                     </td>
158                 </xsl:if>
159             </tr>
160         </xsl:for-each>
161     </table>
162 </xsl:template>
163
164 <!-- Selection reference data -->
165
166 <xsl:key name="SelectionName" match="ParsedSelections/ParsedSelection" use="@Name"/>
167
168 <xsl:template match="InteractiveSession">
169     <h2>Interactive Session</h2>
170     <xsl:apply-imports />
171 </xsl:template>
172
173 <xsl:template match="ParsedSelections">
174     <h2>Parsed Selections</h2>
175     <table border="1">
176         <tr>
177             <th/>
178             <th>Input</th>
179             <xsl:if test="*/String[@Name='Name']">
180                 <th>Name</th>
181             </xsl:if>
182             <th>Text</th>
183             <th>Dynamic</th>
184         </tr>
185         <xsl:for-each select="*">
186         <tr>
187             <td><xsl:value-of select="@Name"/></td>
188             <td><xsl:value-of select="String[@Name='Input']"/></td>
189             <xsl:if test="String[@Name='Name']">
190                 <td><xsl:value-of select="String[@Name='Name']"/></td>
191             </xsl:if>
192             <td><xsl:value-of select="String[@Name='Text']"/></td>
193             <td><xsl:value-of select="Bool[@Name='Dynamic']"/></td>
194         </tr>
195         </xsl:for-each>
196     </table>
197 </xsl:template>
198
199 <xsl:template match="CompiledSelections">
200     <h2>Compiled Selections</h2>
201     <xsl:apply-templates />
202 </xsl:template>
203
204 <xsl:template match="EvaluatedSelections">
205     <h2>Evaluated for <xsl:value-of select="@Name"/></h2>
206     <xsl:apply-templates />
207 </xsl:template>
208
209 <xsl:template match="Selection">
210     <h3><xsl:value-of select="@Name"/></h3>
211     <table>
212         <xsl:if test="String[@Name='Name']">
213             <tr>
214                 <td>Name:</td>
215                 <td><xsl:value-of select="String[@Name='Name']"/></td>
216             </tr>
217         </xsl:if>
218         <tr>
219             <td>Selection text:</td>
220             <td>
221                 <xsl:value-of select="key('SelectionName', @Name)/String[@Name='Text']"/>
222             </td>
223         </tr>
224         <xsl:if test="Sequence[@Name='Atoms']">
225             <tr>
226                 <td>Atoms (<xsl:value-of select="Sequence[@Name='Atoms']/Int[@Name='Length']"/>):</td>
227                 <td>
228                     <xsl:call-template name="SequenceAsCSV">
229                         <xsl:with-param name="root" select="Sequence[@Name='Atoms']"/>
230                     </xsl:call-template>
231                 </td>
232             </tr>
233         </xsl:if>
234     </table>
235     <xsl:apply-templates select="Sequence[@Name='Positions']"/>
236 </xsl:template>
237
238 <xsl:template match="Selection/Sequence[@Name='Positions']">
239     <p>
240         Positions (count: <xsl:value-of select="Int[@Name='Length']"/>):
241         <table border="1">
242             <tr>
243                 <xsl:if test="Position/Sequence[@Name='Atoms']">
244                     <th>Atom count</th>
245                     <th>Atoms</th>
246                 </xsl:if>
247                 <xsl:if test="Position/Int[@Name='RefId']">
248                     <th>RefId</th>
249                     <th>MappedId</th>
250                 </xsl:if>
251                 <xsl:if test="Position/Vector[@Name='Coordinates']">
252                     <th>Coordinates</th>
253                 </xsl:if>
254                 <xsl:if test="Position/Real[@Name='Mass']">
255                     <th>Mass</th>
256                 </xsl:if>
257                 <xsl:if test="Position/Real[@Name='Charge']">
258                     <th>Charge</th>
259                 </xsl:if>
260             </tr>
261             <xsl:for-each select="Position">
262             <tr>
263                 <xsl:if test="Sequence[@Name='Atoms']">
264                     <td><xsl:value-of select="Sequence[@Name='Atoms']/Int[@Name='Length']"/></td>
265                     <td>
266                         <xsl:call-template name="SequenceAsCSV">
267                             <xsl:with-param name="root" select="Sequence[@Name='Atoms']"/>
268                         </xsl:call-template>
269                     </td>
270                 </xsl:if>
271                 <xsl:if test="Int[@Name='RefId']">
272                     <td><xsl:value-of select="Int[@Name='RefId']"/></td>
273                     <td><xsl:value-of select="Int[@Name='MappedId']"/></td>
274                 </xsl:if>
275                 <xsl:if test="Vector[@Name='Coordinates']">
276                     <td>
277                         <xsl:apply-templates select="Vector[@Name='Coordinates']"/>
278                     </td>
279                 </xsl:if>
280                 <xsl:if test="Real[@Name='Mass']">
281                     <td><xsl:value-of select="Real[@Name='Mass']"/></td>
282                 </xsl:if>
283                 <xsl:if test="Real[@Name='Charge']">
284                     <td><xsl:value-of select="Real[@Name='Charge']"/></td>
285                 </xsl:if>
286             </tr>
287             </xsl:for-each>
288         </table>
289     </p>
290 </xsl:template>
291
292 </xsl:stylesheet>