plcopen/variables_infos.xslt
author Laurent Bessard
Sun, 29 Sep 2013 20:17:05 +0200
changeset 1334 b0c2c4e1c1f1
parent 1324 884477877e53
child 1347 533741e5075c
permissions -rw-r--r--
Added support for loading PLCOpen v1 files and modify their content to be compatible with PLCOpen v2
1308
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
     1
<xsl:stylesheet version="1.0"
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
     2
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
     3
    xmlns:ppx="http://www.plcopen.org/xml/tc6_0201"
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
     4
    xmlns:xhtml="http://www.w3.org/1999/xhtml"
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
     5
    xmlns:ns="var_infos_ns"
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
     6
    extension-element-prefixes="ns"
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
     7
    exclude-result-prefixes="ns">
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
     8
  <xsl:template match="ppx:returnType">
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
     9
    <ReturnType>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    10
      <Type><xsl:apply-templates/></Type>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    11
      <Tree><xsl:apply-templates mode="var_tree"/></Tree>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    12
    </ReturnType>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    13
  </xsl:template>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    14
  <xsl:template match="ppx:localVars">
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    15
    <xsl:call-template name="variables_infos">
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    16
      <xsl:with-param name="var_class" select="'Local'"/>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    17
    </xsl:call-template>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    18
  </xsl:template>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    19
  <xsl:template match="ppx:globalVars">
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    20
    <xsl:call-template name="variables_infos">
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    21
      <xsl:with-param name="var_class" select="'Global'"/>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    22
    </xsl:call-template>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    23
  </xsl:template>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    24
  <xsl:template match="ppx:externalVars">
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    25
    <xsl:call-template name="variables_infos">
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    26
      <xsl:with-param name="var_class" select="'External'"/>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    27
    </xsl:call-template>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    28
  </xsl:template>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    29
  <xsl:template match="ppx:tempVars">
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    30
    <xsl:call-template name="variables_infos">
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    31
      <xsl:with-param name="var_class" select="'Temp'"/>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    32
    </xsl:call-template>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    33
  </xsl:template>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    34
  <xsl:template match="ppx:inputVars">
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    35
    <xsl:call-template name="variables_infos">
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    36
      <xsl:with-param name="var_class" select="'Input'"/>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    37
    </xsl:call-template>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    38
  </xsl:template>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    39
  <xsl:template match="ppx:outputVars">
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    40
    <xsl:call-template name="variables_infos">
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    41
      <xsl:with-param name="var_class" select="'Output'"/>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    42
    </xsl:call-template>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    43
  </xsl:template>
1317
177d7cd76a3e Fixed bug in pou variable list and variable tree xslt stylesheet
Laurent Bessard
parents: 1308
diff changeset
    44
  <xsl:template match="ppx:inOutVars">
1308
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    45
    <xsl:call-template name="variables_infos">
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    46
      <xsl:with-param name="var_class" select="'InOut'"/>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    47
    </xsl:call-template>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    48
  </xsl:template>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    49
  <xsl:template name="variables_infos">
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    50
    <xsl:param name="var_class"/>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    51
    <xsl:variable name="var_option">
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    52
      <xsl:choose>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    53
        <xsl:when test="@constant='true' or @constant='1'">
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    54
          <xsl:text>Constant</xsl:text>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    55
        </xsl:when>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    56
        <xsl:when test="@retain='true' or @retain='1'">
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    57
          <xsl:text>Retain</xsl:text>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    58
        </xsl:when>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    59
        <xsl:when test="@nonretain='true' or @nonretain='1'">
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    60
          <xsl:text>Non-Retain</xsl:text>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    61
        </xsl:when>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    62
      </xsl:choose>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    63
    </xsl:variable>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    64
    <xsl:for-each select="ppx:variable">
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    65
      <ns:add_variable>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    66
        <Name><xsl:value-of select="@name"/></Name>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    67
        <Class><xsl:value-of select="$var_class"/></Class>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    68
        <Type><xsl:apply-templates select="ppx:type"/></Type>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    69
        <Option><xsl:value-of select="$var_option"/></Option>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    70
        <Location><xsl:value-of select="@address"/></Location>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    71
        <Initial_Value><xsl:apply-templates select="ppx:initialValue"/></Initial_Value>
1324
884477877e53 Fixed bug in VariablePanel, function block variables in graphic viewers could be modified
Laurent Bessard
parents: 1317
diff changeset
    72
        <Edit><xsl:apply-templates select="ppx:type" mode="var_edit"/></Edit>
1308
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    73
        <Tree><xsl:apply-templates select="ppx:type" mode="var_tree"/></Tree>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    74
        <Documentation>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    75
          <xsl:value-of select="ppx:documentation/xhtml:p/text()"/>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    76
        </Documentation>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    77
      </ns:add_variable>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    78
    </xsl:for-each>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    79
  </xsl:template>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    80
  <xsl:template match="*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:derived">
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    81
    <xsl:value-of select="@name"/>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    82
  </xsl:template>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    83
  <xsl:template match="*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:array">
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    84
    <array>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    85
      <xsl:apply-templates select="ppx:baseType"/>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    86
      <xsl:for-each select="ppx:dimension">
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    87
        <dimension>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    88
          <xsl:attribute name="lower">
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    89
            <xsl:value-of select="@lower"/>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    90
          </xsl:attribute>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    91
          <xsl:attribute name="upper">
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    92
            <xsl:value-of select="@upper"/>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    93
          </xsl:attribute>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    94
        </dimension>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    95
      </xsl:for-each>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    96
    </array>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    97
  </xsl:template>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    98
  <xsl:template match="*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:string">
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
    99
    <xsl:text>STRING</xsl:text>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   100
  </xsl:template>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   101
  <xsl:template match="*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:wstring">
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   102
    <xsl:text>WSTRING</xsl:text>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   103
  </xsl:template>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   104
  <xsl:template match="*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/*">
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   105
    <xsl:value-of select="local-name()"/>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   106
  </xsl:template>
1324
884477877e53 Fixed bug in VariablePanel, function block variables in graphic viewers could be modified
Laurent Bessard
parents: 1317
diff changeset
   107
  <xsl:template match="*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:derived" mode="var_edit">
884477877e53 Fixed bug in VariablePanel, function block variables in graphic viewers could be modified
Laurent Bessard
parents: 1317
diff changeset
   108
    <ns:is_edited/>
884477877e53 Fixed bug in VariablePanel, function block variables in graphic viewers could be modified
Laurent Bessard
parents: 1317
diff changeset
   109
  </xsl:template>
884477877e53 Fixed bug in VariablePanel, function block variables in graphic viewers could be modified
Laurent Bessard
parents: 1317
diff changeset
   110
  <xsl:template match="*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/*" mode="var_edit">
884477877e53 Fixed bug in VariablePanel, function block variables in graphic viewers could be modified
Laurent Bessard
parents: 1317
diff changeset
   111
    <xsl:text>True</xsl:text>
884477877e53 Fixed bug in VariablePanel, function block variables in graphic viewers could be modified
Laurent Bessard
parents: 1317
diff changeset
   112
  </xsl:template>
884477877e53 Fixed bug in VariablePanel, function block variables in graphic viewers could be modified
Laurent Bessard
parents: 1317
diff changeset
   113
  <xsl:template match="ppx:initialValue">
1308
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   114
    <xsl:apply-templates/>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   115
  </xsl:template>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   116
  <xsl:template match="ppx:value">
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   117
    <xsl:choose>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   118
      <xsl:when test="@repetitionValue">
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   119
        <xsl:value-of select="@repetitionValue"/>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   120
        <xsl:text>(</xsl:text>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   121
        <xsl:apply-templates/>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   122
        <xsl:text>)</xsl:text>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   123
      </xsl:when>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   124
      <xsl:when test="@member">
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   125
        <xsl:value-of select="@member"/>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   126
        <xsl:text> := </xsl:text>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   127
        <xsl:apply-templates/>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   128
      </xsl:when>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   129
      <xsl:otherwise>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   130
        <xsl:apply-templates/>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   131
      </xsl:otherwise>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   132
    </xsl:choose>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   133
  </xsl:template>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   134
  <xsl:template match="ppx:simpleValue">
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   135
    <xsl:value-of select="@value"/>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   136
  </xsl:template>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   137
  <xsl:template match="ppx:arrayValue">
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   138
    <xsl:text>[</xsl:text>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   139
    <xsl:for-each select="ppx:value">
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   140
      <xsl:apply-templates select="."/>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   141
      <xsl:choose>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   142
        <xsl:when test="position()!=last()">
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   143
          <xsl:text>, </xsl:text>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   144
        </xsl:when>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   145
      </xsl:choose>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   146
    </xsl:for-each>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   147
    <xsl:text>]</xsl:text>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   148
  </xsl:template>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   149
  <xsl:template match="ppx:structValue">
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   150
    <xsl:text>(</xsl:text>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   151
    <xsl:for-each select="ppx:value">
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   152
      <xsl:apply-templates select="."/>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   153
      <xsl:choose>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   154
        <xsl:when test="position()!=last()">
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   155
          <xsl:text>, </xsl:text>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   156
        </xsl:when>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   157
      </xsl:choose>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   158
    </xsl:for-each>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   159
    <xsl:text>)</xsl:text>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   160
  </xsl:template>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   161
  <xsl:template match="ppx:pou" mode="var_tree">
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   162
    <xsl:apply-templates select="ppx:interface/*[self::ppx:inputVars or self::ppx:inOutVars or self::ppx:outputVars]/ppx:variable" mode="var_tree"/>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   163
  </xsl:template>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   164
  <xsl:template match="ppx:variable" mode="var_tree">
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   165
    <var>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   166
      <xsl:attribute name="name">
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   167
        <xsl:value-of select="@name"/>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   168
      </xsl:attribute>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   169
      <xsl:apply-templates select="ppx:type" mode="var_tree"/>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   170
    </var>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   171
  </xsl:template>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   172
  <xsl:template match="ppx:dataType">
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   173
    <xsl:apply-templates select="ppx:baseType" mode="var_tree"/>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   174
  </xsl:template>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   175
  <xsl:template match="*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:struct" mode="var_tree">
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   176
    <xsl:apply-templates select="ppx:variable" mode="var_tree"/>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   177
  </xsl:template>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   178
  <xsl:template match="*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:derived" mode="var_tree">
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   179
    <ns:var_tree/>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   180
    <xsl:choose>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   181
      <xsl:when test="count(./*) > 0">
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   182
        <xsl:apply-templates mode="var_tree"/>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   183
      </xsl:when>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   184
      <xsl:otherwise>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   185
        <xsl:value-of select="@name"/>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   186
      </xsl:otherwise>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   187
    </xsl:choose>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   188
  </xsl:template>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   189
  <xsl:template match="*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:array" mode="var_tree">
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   190
    <xsl:apply-templates select="ppx:baseType" mode="var_tree"/>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   191
    <xsl:for-each select="ppx:dimension">
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   192
      <dimension>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   193
        <xsl:attribute name="lower">
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   194
          <xsl:value-of select="@lower"/>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   195
        </xsl:attribute>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   196
        <xsl:attribute name="upper">
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   197
          <xsl:value-of select="@upper"/>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   198
        </xsl:attribute>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   199
      </dimension>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   200
    </xsl:for-each>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   201
  </xsl:template>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   202
  <xsl:template match="*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:string" mode="var_tree">
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   203
    <xsl:text>STRING</xsl:text>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   204
  </xsl:template>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   205
  <xsl:template match="*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:wstring" mode="var_tree">
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   206
    <xsl:text>WSTRING</xsl:text>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   207
  </xsl:template>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   208
  <xsl:template match="*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/*" mode="var_tree">
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   209
    <xsl:value-of select="local-name()"/>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   210
  </xsl:template>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   211
  <xsl:template match="text()"/>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   212
  <xsl:template match="text()" mode="var_tree"/>
ad61268dbdb6 Replaced old pou variable list and variable tree generating by xslt stylesheet
Laurent Bessard
parents:
diff changeset
   213
</xsl:stylesheet>