Merge release-4-6 into master
[alexxy/gromacs.git] / src / gromacs / analysisdata / tests / refdata / common-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 If you modify one of these files, please keep others in sync.
7 -->
8 <xsl:stylesheet version="1.0"
9     xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
10
11 <xsl:template match="/">
12     <html><body>
13         <xsl:apply-templates/>
14     </body></html>
15 </xsl:template>
16
17 <xsl:template match="/ReferenceData">
18     <h1>Test Reference Data</h1>
19     <xsl:apply-templates/>
20 </xsl:template>
21
22 <xsl:template match="Vector">
23     (<xsl:value-of select="*[@Name='X']"/>;
24      <xsl:value-of select="*[@Name='Y']"/>;
25      <xsl:value-of select="*[@Name='Z']"/>)
26 </xsl:template>
27
28 <xsl:template name="SequenceAsHorizontalTable">
29     <xsl:param name="root" select="."/>
30     <table border="1">
31         <tr><th>Count</th><th>Items</th></tr>
32         <tr>
33             <td><xsl:value-of select="$root/Int[@Name='Length']"/></td>
34             <td>
35                 <xsl:call-template name="SequenceAsCSV">
36                     <xsl:with-param name="root" select="$root"/>
37                 </xsl:call-template>
38             </td>
39         </tr>
40     </table>
41 </xsl:template>
42
43 <xsl:template name="SequenceAsCSV">
44     <xsl:param name="root" select="."/>
45     <xsl:for-each select="$root/*[position() &gt; 1]">
46         <xsl:apply-templates select="."/>
47         <xsl:if test="position() &lt; last()">, </xsl:if>
48     </xsl:for-each>
49 </xsl:template>
50
51 <xsl:template name="Bool">
52     <xsl:value-of select="."/>
53 </xsl:template>
54
55 <xsl:template name="String">
56     <xsl:value-of select="."/>
57 </xsl:template>
58
59 <xsl:template name="Int">
60     <xsl:value-of select="."/>
61 </xsl:template>
62
63 <xsl:template name="Real">
64     <xsl:value-of select="."/>
65 </xsl:template>
66
67 </xsl:stylesheet>