Tests for interactive selection input
[alexxy/gromacs.git] / src / gromacs / analysisdata / tests / refdata / common-referencedata.xsl
index 1df2ad74b7897aaf95bfdc3e26fc9e7918f1d112..b6e9bcfdb67f16b17e6b79715d4980024cf82b08 100644 (file)
@@ -3,7 +3,9 @@
 <!--
 This file is currently duplicated to each directory containing reference data
 XML files. This is to make it compatible with more browsers.
-If you modify one of these files, please keep others in sync.
+To keep these files in sync, please only modify the version in
+  src/testutils/
+and use the copy_xsl.sh script to copy it to relevant locations.
 -->
 <xsl:stylesheet version="1.0"
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
@@ -42,9 +44,11 @@ If you modify one of these files, please keep others in sync.
 
 <xsl:template name="SequenceAsCSV">
     <xsl:param name="root" select="."/>
-    <xsl:for-each select="$root/*[position() &gt; 1]">
-        <xsl:apply-templates select="."/>
-        <xsl:if test="position() &lt; last()">, </xsl:if>
+    <xsl:for-each select="$root/*">
+        <xsl:if test="not(.[@Name])">
+            <xsl:apply-templates select="."/>
+            <xsl:if test="position() &lt; last()">, </xsl:if>
+        </xsl:if>
     </xsl:for-each>
 </xsl:template>
 
@@ -64,4 +68,31 @@ If you modify one of these files, please keep others in sync.
     <xsl:value-of select="."/>
 </xsl:template>
 
+<xsl:template match="InteractiveSession">
+    <pre>
+        <xsl:for-each select="*">
+            <xsl:choose>
+                <xsl:when test="starts-with(@Name, 'Output')">
+                    <xsl:value-of select="substring(.,2)"/>
+                </xsl:when>
+                <xsl:when test="string-length(.)=1">
+                    <xsl:text>&#x25ba;</xsl:text>
+                    <xsl:text>&#xb6;</xsl:text>
+                </xsl:when>
+                <xsl:when test="contains(substring(.,2), '&#10;')">
+                    <xsl:text>&#x25ba;</xsl:text>
+                    <xsl:value-of select="translate(substring(.,2), '&#10;', '&#x23ce;')"/>
+                    <xsl:text>&#10;</xsl:text>
+                </xsl:when>
+                <xsl:otherwise>
+                    <xsl:text>&#x25ba;</xsl:text>
+                    <xsl:value-of select="substring(.,2)"/>
+                    <xsl:text>&#xb6;</xsl:text>
+                </xsl:otherwise>
+            </xsl:choose>
+        </xsl:for-each>
+        <xsl:text>[EOF]</xsl:text>
+    </pre>
+</xsl:template>
+
 </xsl:stylesheet>