File: misc.xsl

package info (click to toggle)
xgridfit 2.2a-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 2,232 kB
  • sloc: python: 1,262; xml: 466; sh: 283; makefile: 114; sed: 45
file content (82 lines) | stat: -rw-r--r-- 2,940 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
		xmlns:xgf="http://xgridfit.sourceforge.net/Xgridfit2"
		version="1.0">

  <!-- This file is part of xgridfit.
       It is distributed under the GNU Public License, version 2.
       Copyright (c) 2006-10 by Peter S. Baker
  -->
  
  <xsl:template name="do-instctrl">
    <xsl:param name="selector"/>
    <xsl:param name="val"/>
    <xsl:param name="caller"/>
    <xsl:choose>
      <xsl:when test="ancestor::xgf:pre-program">
        <xsl:call-template name="push-num">
          <xsl:with-param name="num" select="$val"/>
          <xsl:with-param name="expect" select="2"/>
        </xsl:call-template>
        <xsl:call-template name="push-num">
          <xsl:with-param name="num" select="$selector"/>
          <xsl:with-param name="add-mode" select="true()"/>
        </xsl:call-template>
        <xsl:call-template name="simple-command">
          <xsl:with-param name="cmd" select="'INSTCTRL'"/>
        </xsl:call-template>
      </xsl:when>
      <xsl:otherwise>
        <xsl:call-template name="warning">
          <xsl:with-param name="msg">
            <xsl:text>&lt;</xsl:text>
            <xsl:value-of select="$caller"/>
            <xsl:text>&gt; can be used only in the</xsl:text>
            <xsl:value-of select="$newline"/>
            <xsl:text>&lt;pre-program&gt;. It is being ignored.</xsl:text>
          </xsl:with-param>
        </xsl:call-template>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>

  <xsl:template match="xgf:getinfo">
    <xsl:param name="mp-container"/>
    <xsl:call-template name="debug-start"/>
    <xsl:variable name="s" select="normalize-space(@selector)"/>
    <xsl:call-template name="expression">
      <xsl:with-param name="val" select="$s"/>
      <xsl:with-param name="getinfo-index" select="true()"/>
      <xsl:with-param name="mp-container" select="$mp-container"/>
      <xsl:with-param name="to-stack" select="true()"/>
    </xsl:call-template>
    <xsl:call-template name="simple-command">
      <xsl:with-param name="cmd" select="'GETINFO'"/>
    </xsl:call-template>
    <xsl:choose>
      <xsl:when test="@result-to">
        <xsl:call-template name="store-value">
          <xsl:with-param name="vname" select="@result-to"/>
	  <xsl:with-param name="mp-container"
			  select="$mp-container"/>
        </xsl:call-template>
      </xsl:when>
      <xsl:otherwise>
	<xsl:call-template name="warning">
	  <xsl:with-param name="msg">
	    <xsl:text>No place to store result of GETINFO. </xsl:text>
	    <xsl:text>It will be left on the stack.</xsl:text>
	  </xsl:with-param>
	</xsl:call-template>
      </xsl:otherwise>
    </xsl:choose>
    <xsl:call-template name="debug-end"/>
  </xsl:template>

  <xsl:template match="xgf:message">
    <xsl:message terminate="no">
      <xsl:value-of select="."/>
    </xsl:message>
  </xsl:template>

</xsl:stylesheet>