9223385238c2e5c31edd3d1071226396511a3791
[alexxy/gromacs.git] / src / gromacs / analysisdata / tests / refdata / analysisdata-referencedata.xsl
1 <?xml version="1.0"?>
2
3 <!--
4 This file is currently duplicated to each directory containing reference data
5 XML files. This is to make it compatible with more browsers.
6 To keep these files in sync, please only modify the version in
7   src/testutils/
8 and use the copy_xsl.sh script to copy it to relevant locations.
9 -->
10 <xsl:stylesheet version="1.0"
11     xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
12
13 <xsl:import href="common-referencedata.xsl"/>
14
15 <xsl:template match="AnalysisData">
16     <xsl:variable name="has-datasetspec"
17                   select="DataFrame/DataValues/Int[@Name='DataSet']"/>
18     <xsl:variable name="has-columnspec"
19                   select="DataFrame/DataValues/Int[@Name='FirstColumn']"/>
20     <table border="1">
21         <tr>
22             <th>Frame</th>
23             <th>X</th>
24             <xsl:if test="$has-datasetspec">
25                 <th>Set</th>
26             </xsl:if>
27             <xsl:if test="$has-columnspec">
28                 <th>Columns</th>
29             </xsl:if>
30             <th>Values</th>
31         </tr>
32         <xsl:for-each select="DataFrame/DataValues">
33         <tr>
34             <td><xsl:value-of select="../@Name"/></td>
35             <td><xsl:value-of select="../Real[@Name='X']"/></td>
36             <xsl:if test="$has-datasetspec">
37                 <td><xsl:value-of select="Int[@Name='DataSet']"/></td>
38             </xsl:if>
39             <xsl:if test="$has-columnspec">
40                 <td>
41                     <xsl:choose>
42                         <xsl:when test="Int[@Name='FirstColumn']">
43                             <xsl:value-of select="Int[@Name='FirstColumn']"/>
44                             <xsl:text>-</xsl:text>
45                             <xsl:value-of select="Int[@Name='LastColumn']"/>
46                         </xsl:when>
47                         <xsl:otherwise>all</xsl:otherwise>
48                     </xsl:choose>
49                 </td>
50             </xsl:if>
51             <td><xsl:call-template name="SequenceAsCSV"/></td>
52         </tr>
53         </xsl:for-each>
54     </table>
55 </xsl:template>
56
57 <xsl:template match="DataValue[Bool[@Name='Present']='false']">
58     (
59     <xsl:value-of select="Real[@Name='Value']"/>
60     <xsl:if test="Real[@Name='Error']">
61         &#177; <xsl:value-of select="Real[@Name='Error']"/>
62     </xsl:if>
63     )
64 </xsl:template>
65 <xsl:template match="DataValue">
66     <xsl:value-of select="Real[@Name='Value']"/>
67     <xsl:if test="Real[@Name='Error']">
68         &#177; <xsl:value-of select="Real[@Name='Error']"/>
69     </xsl:if>
70 </xsl:template>
71
72 </xsl:stylesheet>