plcopen/variables_infos.xslt
changeset 1349 be6c3a036844
parent 1347 533741e5075c
child 1359 cce13b237b07
equal deleted inserted replaced
1348:aee0a7eb833a 1349:be6c3a036844
     1 <xsl:stylesheet xmlns:func="http://exslt.org/functions" xmlns:dyn="http://exslt.org/dynamic" xmlns:str="http://exslt.org/strings" xmlns:math="http://exslt.org/math" xmlns:exsl="http://exslt.org/common" extension-element-prefixes="ns" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:yml="http://fdik.org/yml" xmlns:set="http://exslt.org/sets" version="1.0" xmlns:ppx="http://www.plcopen.org/xml/tc6_0201" xmlns:ns="var_infos_ns" exclude-result-prefixes="ns" xmlns:regexp="http://exslt.org/regular-expressions" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:output method="xml"/><xsl:variable name="space" select="'                                                                                                                                                                                                        '"/><xsl:param name="autoindent" select="4"/><xsl:param name="tree"/><xsl:template match="text()"><xsl:param name="_indent" select="0"/></xsl:template><xsl:variable name="project"><xsl:choose><xsl:when test="$tree='True'"><xsl:copy-of select="document('project')/project/*"/></xsl:when></xsl:choose></xsl:variable><xsl:variable name="stdlib"><xsl:choose><xsl:when test="$tree='True'"><xsl:copy-of select="document('stdlib')/stdlib/*"/></xsl:when></xsl:choose></xsl:variable><xsl:variable name="extensions"><xsl:choose><xsl:when test="$tree='True'"><xsl:copy-of select="document('extensions')/extensions/*"/></xsl:when></xsl:choose></xsl:variable><xsl:template match="ppx:returnType"><xsl:param name="_indent" select="0"/><xsl:value-of select="ns:AddTree()"/><xsl:apply-templates><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates></xsl:template><xsl:template name="variables_infos"><xsl:param name="_indent" select="0"/><xsl:param name="var_class"/><xsl:variable name="var_option"><xsl:choose><xsl:when test="@constant='true' or @constant='1'"><xsl:text>Constant</xsl:text></xsl:when><xsl:when test="@retain='true' or @retain='1'"><xsl:text>Retain</xsl:text></xsl:when><xsl:when test="@nonretain='true' or @nonretain='1'"><xsl:text>Non-Retain</xsl:text></xsl:when></xsl:choose></xsl:variable><xsl:for-each select="ppx:variable"><xsl:variable name="initial_value"><xsl:apply-templates select="ppx:initialValue"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates></xsl:variable><xsl:variable name="edit"><xsl:choose><xsl:when test="$var_class='Global' or $var_class='External'"><xsl:text>true</xsl:text></xsl:when><xsl:otherwise><xsl:apply-templates mode="var_edit" select="ppx:type"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates></xsl:otherwise></xsl:choose></xsl:variable><xsl:value-of select="ns:AddTree()"/><xsl:apply-templates select="ppx:type"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates><xsl:value-of select="ns:AddVariable(@name, $var_class, $var_option, @address, $initial_value, $edit, ppx:documentation/xhtml:p/text())"/></xsl:for-each></xsl:template><xsl:template match="ppx:localVars"><xsl:param name="_indent" select="0"/><xsl:call-template name="variables_infos"><xsl:with-param name="var_class"><xsl:text>Local</xsl:text></xsl:with-param></xsl:call-template></xsl:template><xsl:template match="ppx:globalVars"><xsl:param name="_indent" select="0"/><xsl:call-template name="variables_infos"><xsl:with-param name="var_class"><xsl:text>Global</xsl:text></xsl:with-param></xsl:call-template></xsl:template><xsl:template match="ppx:externalVars"><xsl:param name="_indent" select="0"/><xsl:call-template name="variables_infos"><xsl:with-param name="var_class"><xsl:text>External</xsl:text></xsl:with-param></xsl:call-template></xsl:template><xsl:template match="ppx:tempVars"><xsl:param name="_indent" select="0"/><xsl:call-template name="variables_infos"><xsl:with-param name="var_class"><xsl:text>Temp</xsl:text></xsl:with-param></xsl:call-template></xsl:template><xsl:template match="ppx:inputVars"><xsl:param name="_indent" select="0"/><xsl:call-template name="variables_infos"><xsl:with-param name="var_class"><xsl:text>Input</xsl:text></xsl:with-param></xsl:call-template></xsl:template><xsl:template match="ppx:outputVars"><xsl:param name="_indent" select="0"/><xsl:call-template name="variables_infos"><xsl:with-param name="var_class"><xsl:text>Output</xsl:text></xsl:with-param></xsl:call-template></xsl:template><xsl:template match="ppx:inOutVars"><xsl:param name="_indent" select="0"/><xsl:call-template name="variables_infos"><xsl:with-param name="var_class"><xsl:text>InOut</xsl:text></xsl:with-param></xsl:call-template></xsl:template><xsl:template match="ppx:pou"><xsl:param name="_indent" select="0"/><xsl:apply-templates select="ppx:interface/*[self::ppx:inputVars or self::ppx:inOutVars or self::ppx:outputVars]/ppx:variable"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates></xsl:template><xsl:template match="ppx:variable"><xsl:param name="_indent" select="0"/><xsl:variable name="name"><xsl:value-of select="@name"/></xsl:variable><xsl:value-of select="ns:AddTree($name)"/><xsl:apply-templates select="ppx:type"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates><xsl:value-of select="ns:AddVarToTree($name)"/></xsl:template><xsl:template match="ppx:dataType"><xsl:param name="_indent" select="0"/><xsl:apply-templates select="ppx:baseType"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates></xsl:template><xsl:template match="*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:struct"><xsl:param name="_indent" select="0"/><xsl:apply-templates select="ppx:variable"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates></xsl:template><xsl:template match="*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:derived"><xsl:param name="_indent" select="0"/><xsl:variable name="type_name"><xsl:value-of select="@name"/></xsl:variable><xsl:choose><xsl:when test="$tree='True'"><xsl:apply-templates select="exsl:node-set($project)/ppx:project/ppx:types/ppx:pous/ppx:pou[@name=$type_name] |&#10;                         exsl:node-set($project)/ppx:project/ppx:types/ppx:dataTypes/ppx:dataType[@name=$type_name] |&#10;                         exsl:node-set($stdlib)/ppx:project/ppx:types/ppx:pous/ppx:pou[@name=$type_name] |&#10;                         exsl:node-set($stdlib)/ppx:project/ppx:types/ppx:dataTypes/ppx:dataType[@name=$type_name] |&#10;                         exsl:node-set($extensions)/ppx:project/ppx:types/ppx:pous/ppx:pou[@name=$type_name] |&#10;                         exsl:node-set($extensions)/ppx:project/ppx:types/ppx:dataTypes/ppx:dataType[@name=$type_name]"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates></xsl:when></xsl:choose><xsl:value-of select="ns:SetType($type_name)"/></xsl:template><xsl:template match="*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:array"><xsl:param name="_indent" select="0"/><xsl:apply-templates select="ppx:baseType"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates><xsl:for-each select="ppx:dimension"><xsl:value-of select="ns:AddDimension(@lower, @upper)"/></xsl:for-each></xsl:template><xsl:template match="*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:string"><xsl:param name="_indent" select="0"/><xsl:variable name="name"><xsl:text>STRING</xsl:text></xsl:variable><xsl:value-of select="ns:SetType($name)"/></xsl:template><xsl:template match="*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:wstring"><xsl:param name="_indent" select="0"/><xsl:variable name="name"><xsl:text>WSTRING</xsl:text></xsl:variable><xsl:value-of select="ns:SetType($name)"/></xsl:template><xsl:template match="*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/*"><xsl:param name="_indent" select="0"/><xsl:variable name="name"><xsl:value-of select="local-name()"/></xsl:variable><xsl:value-of select="ns:SetType($name)"/></xsl:template><xsl:template mode="var_edit" match="*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:derived"><xsl:param name="_indent" select="0"/><xsl:variable name="type_name" select="@name"/><xsl:variable name="pou_infos"><xsl:copy-of select="exsl:node-set($project)/ppx:project/ppx:types/ppx:pous/ppx:pou[@name=$type_name] |&#10;                    exsl:node-set($stdlib)/ppx:project/ppx:types/ppx:pous/ppx:pou[@name=$type_name] |&#10;                    exsl:node-set($extensions)/ppx:project/ppx:types/ppx:pous/ppx:pou[@name=$type_name]"/></xsl:variable><xsl:choose><xsl:when test="$pou_infos != ''"><xsl:text>false</xsl:text></xsl:when><xsl:otherwise><xsl:text>true</xsl:text></xsl:otherwise></xsl:choose></xsl:template><xsl:template mode="var_edit" match="*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/*"><xsl:param name="_indent" select="0"/><xsl:text>true</xsl:text></xsl:template><xsl:template match="ppx:value"><xsl:param name="_indent" select="0"/><xsl:choose><xsl:when test="@repetitionValue"><xsl:value-of select="@repetitionValue"/><xsl:text>(</xsl:text><xsl:apply-templates><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates><xsl:text>)</xsl:text></xsl:when><xsl:when test="@member"><xsl:value-of select="@member"/><xsl:text> := </xsl:text><xsl:apply-templates><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates></xsl:when><xsl:otherwise><xsl:apply-templates><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates></xsl:otherwise></xsl:choose></xsl:template><xsl:template match="ppx:simpleValue"><xsl:param name="_indent" select="0"/><xsl:value-of select="@value"/></xsl:template><xsl:template name="complex_type_value"><xsl:param name="_indent" select="0"/><xsl:param name="start_bracket"/><xsl:param name="end_bracket"/><xsl:value-of select="@start_bracket"/><xsl:for-each select="ppx:value"><xsl:apply-templates select="."><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates><xsl:choose><xsl:when test="position()!=last()"><xsl:text>, </xsl:text></xsl:when></xsl:choose></xsl:for-each><xsl:value-of select="@end_bracket"/></xsl:template><xsl:template match="ppx:arrayValue"><xsl:param name="_indent" select="0"/><xsl:call-template name="complex_type_value"><xsl:with-param name="start_bracket"><xsl:text>[</xsl:text></xsl:with-param><xsl:with-param name="end_bracket"><xsl:text>]</xsl:text></xsl:with-param></xsl:call-template></xsl:template><xsl:template match="ppx:structValue"><xsl:param name="_indent" select="0"/><xsl:call-template name="complex_type_value"><xsl:with-param name="start_bracket"><xsl:text>(</xsl:text></xsl:with-param><xsl:with-param name="end_bracket"><xsl:text>)</xsl:text></xsl:with-param></xsl:call-template></xsl:template></xsl:stylesheet>
     1 <?xml version="1.0"?>
       
     2 <xsl:stylesheet xmlns:func="http://exslt.org/functions" xmlns:dyn="http://exslt.org/dynamic" xmlns:str="http://exslt.org/strings" xmlns:math="http://exslt.org/math" xmlns:exsl="http://exslt.org/common" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:yml="http://fdik.org/yml" xmlns:set="http://exslt.org/sets" xmlns:ppx="http://www.plcopen.org/xml/tc6_0201" xmlns:ns="var_infos_ns" xmlns:regexp="http://exslt.org/regular-expressions" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" extension-element-prefixes="ns" version="1.0" exclude-result-prefixes="ns">
       
     3   <xsl:output method="xml"/>
       
     4   <xsl:variable name="space" select="'                                                                                                                                                                                                        '"/>
       
     5   <xsl:param name="autoindent" select="4"/>
       
     6   <xsl:param name="tree"/>
       
     7   <xsl:template match="text()">
       
     8     <xsl:param name="_indent" select="0"/>
       
     9   </xsl:template>
       
    10   <xsl:variable name="project">
       
    11     <xsl:choose>
       
    12       <xsl:when test="$tree='True'">
       
    13         <xsl:copy-of select="document('project')/project/*"/>
       
    14       </xsl:when>
       
    15     </xsl:choose>
       
    16   </xsl:variable>
       
    17   <xsl:variable name="stdlib">
       
    18     <xsl:choose>
       
    19       <xsl:when test="$tree='True'">
       
    20         <xsl:copy-of select="document('stdlib')/stdlib/*"/>
       
    21       </xsl:when>
       
    22     </xsl:choose>
       
    23   </xsl:variable>
       
    24   <xsl:variable name="extensions">
       
    25     <xsl:choose>
       
    26       <xsl:when test="$tree='True'">
       
    27         <xsl:copy-of select="document('extensions')/extensions/*"/>
       
    28       </xsl:when>
       
    29     </xsl:choose>
       
    30   </xsl:variable>
       
    31   <xsl:template match="ppx:returnType">
       
    32     <xsl:param name="_indent" select="0"/>
       
    33     <xsl:value-of select="ns:AddTree()"/>
       
    34     <xsl:apply-templates>
       
    35       <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/>
       
    36     </xsl:apply-templates>
       
    37   </xsl:template>
       
    38   <xsl:template name="variables_infos">
       
    39     <xsl:param name="_indent" select="0"/>
       
    40     <xsl:param name="var_class"/>
       
    41     <xsl:variable name="var_option">
       
    42       <xsl:choose>
       
    43         <xsl:when test="@constant='true' or @constant='1'">
       
    44           <xsl:text>Constant</xsl:text>
       
    45         </xsl:when>
       
    46         <xsl:when test="@retain='true' or @retain='1'">
       
    47           <xsl:text>Retain</xsl:text>
       
    48         </xsl:when>
       
    49         <xsl:when test="@nonretain='true' or @nonretain='1'">
       
    50           <xsl:text>Non-Retain</xsl:text>
       
    51         </xsl:when>
       
    52       </xsl:choose>
       
    53     </xsl:variable>
       
    54     <xsl:for-each select="ppx:variable">
       
    55       <xsl:variable name="initial_value">
       
    56         <xsl:apply-templates select="ppx:initialValue">
       
    57           <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/>
       
    58         </xsl:apply-templates>
       
    59       </xsl:variable>
       
    60       <xsl:variable name="edit">
       
    61         <xsl:choose>
       
    62           <xsl:when test="$var_class='Global' or $var_class='External'">
       
    63             <xsl:text>true</xsl:text>
       
    64           </xsl:when>
       
    65           <xsl:otherwise>
       
    66             <xsl:apply-templates mode="var_edit" select="ppx:type">
       
    67               <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/>
       
    68             </xsl:apply-templates>
       
    69           </xsl:otherwise>
       
    70         </xsl:choose>
       
    71       </xsl:variable>
       
    72       <xsl:value-of select="ns:AddTree()"/>
       
    73       <xsl:apply-templates select="ppx:type">
       
    74         <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/>
       
    75       </xsl:apply-templates>
       
    76       <xsl:value-of select="ns:AddVariable(@name, $var_class, $var_option, @address, $initial_value, $edit, ppx:documentation/xhtml:p/text())"/>
       
    77     </xsl:for-each>
       
    78   </xsl:template>
       
    79   <xsl:template match="ppx:localVars">
       
    80     <xsl:param name="_indent" select="0"/>
       
    81     <xsl:call-template name="variables_infos">
       
    82       <xsl:with-param name="var_class">
       
    83         <xsl:text>Local</xsl:text>
       
    84       </xsl:with-param>
       
    85     </xsl:call-template>
       
    86   </xsl:template>
       
    87   <xsl:template match="ppx:globalVars">
       
    88     <xsl:param name="_indent" select="0"/>
       
    89     <xsl:call-template name="variables_infos">
       
    90       <xsl:with-param name="var_class">
       
    91         <xsl:text>Global</xsl:text>
       
    92       </xsl:with-param>
       
    93     </xsl:call-template>
       
    94   </xsl:template>
       
    95   <xsl:template match="ppx:externalVars">
       
    96     <xsl:param name="_indent" select="0"/>
       
    97     <xsl:call-template name="variables_infos">
       
    98       <xsl:with-param name="var_class">
       
    99         <xsl:text>External</xsl:text>
       
   100       </xsl:with-param>
       
   101     </xsl:call-template>
       
   102   </xsl:template>
       
   103   <xsl:template match="ppx:tempVars">
       
   104     <xsl:param name="_indent" select="0"/>
       
   105     <xsl:call-template name="variables_infos">
       
   106       <xsl:with-param name="var_class">
       
   107         <xsl:text>Temp</xsl:text>
       
   108       </xsl:with-param>
       
   109     </xsl:call-template>
       
   110   </xsl:template>
       
   111   <xsl:template match="ppx:inputVars">
       
   112     <xsl:param name="_indent" select="0"/>
       
   113     <xsl:call-template name="variables_infos">
       
   114       <xsl:with-param name="var_class">
       
   115         <xsl:text>Input</xsl:text>
       
   116       </xsl:with-param>
       
   117     </xsl:call-template>
       
   118   </xsl:template>
       
   119   <xsl:template match="ppx:outputVars">
       
   120     <xsl:param name="_indent" select="0"/>
       
   121     <xsl:call-template name="variables_infos">
       
   122       <xsl:with-param name="var_class">
       
   123         <xsl:text>Output</xsl:text>
       
   124       </xsl:with-param>
       
   125     </xsl:call-template>
       
   126   </xsl:template>
       
   127   <xsl:template match="ppx:inOutVars">
       
   128     <xsl:param name="_indent" select="0"/>
       
   129     <xsl:call-template name="variables_infos">
       
   130       <xsl:with-param name="var_class">
       
   131         <xsl:text>InOut</xsl:text>
       
   132       </xsl:with-param>
       
   133     </xsl:call-template>
       
   134   </xsl:template>
       
   135   <xsl:template match="ppx:pou">
       
   136     <xsl:param name="_indent" select="0"/>
       
   137     <xsl:apply-templates select="ppx:interface/*[self::ppx:inputVars or self::ppx:inOutVars or self::ppx:outputVars]/ppx:variable">
       
   138       <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/>
       
   139     </xsl:apply-templates>
       
   140   </xsl:template>
       
   141   <xsl:template match="ppx:variable">
       
   142     <xsl:param name="_indent" select="0"/>
       
   143     <xsl:variable name="name">
       
   144       <xsl:value-of select="@name"/>
       
   145     </xsl:variable>
       
   146     <xsl:value-of select="ns:AddTree($name)"/>
       
   147     <xsl:apply-templates select="ppx:type">
       
   148       <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/>
       
   149     </xsl:apply-templates>
       
   150     <xsl:value-of select="ns:AddVarToTree($name)"/>
       
   151   </xsl:template>
       
   152   <xsl:template match="ppx:dataType">
       
   153     <xsl:param name="_indent" select="0"/>
       
   154     <xsl:apply-templates select="ppx:baseType">
       
   155       <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/>
       
   156     </xsl:apply-templates>
       
   157   </xsl:template>
       
   158   <xsl:template match="*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:struct">
       
   159     <xsl:param name="_indent" select="0"/>
       
   160     <xsl:apply-templates select="ppx:variable">
       
   161       <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/>
       
   162     </xsl:apply-templates>
       
   163   </xsl:template>
       
   164   <xsl:template match="*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:derived">
       
   165     <xsl:param name="_indent" select="0"/>
       
   166     <xsl:variable name="type_name">
       
   167       <xsl:value-of select="@name"/>
       
   168     </xsl:variable>
       
   169     <xsl:choose>
       
   170       <xsl:when test="$tree='True'">
       
   171         <xsl:apply-templates select="exsl:node-set($project)/ppx:project/ppx:types/ppx:pous/ppx:pou[@name=$type_name] |&#10;                         exsl:node-set($project)/ppx:project/ppx:types/ppx:dataTypes/ppx:dataType[@name=$type_name] |&#10;                         exsl:node-set($stdlib)/ppx:project/ppx:types/ppx:pous/ppx:pou[@name=$type_name] |&#10;                         exsl:node-set($stdlib)/ppx:project/ppx:types/ppx:dataTypes/ppx:dataType[@name=$type_name] |&#10;                         exsl:node-set($extensions)/ppx:project/ppx:types/ppx:pous/ppx:pou[@name=$type_name] |&#10;                         exsl:node-set($extensions)/ppx:project/ppx:types/ppx:dataTypes/ppx:dataType[@name=$type_name]">
       
   172           <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/>
       
   173         </xsl:apply-templates>
       
   174       </xsl:when>
       
   175     </xsl:choose>
       
   176     <xsl:value-of select="ns:SetType($type_name)"/>
       
   177   </xsl:template>
       
   178   <xsl:template match="*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:array">
       
   179     <xsl:param name="_indent" select="0"/>
       
   180     <xsl:apply-templates select="ppx:baseType">
       
   181       <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/>
       
   182     </xsl:apply-templates>
       
   183     <xsl:for-each select="ppx:dimension">
       
   184       <xsl:value-of select="ns:AddDimension(@lower, @upper)"/>
       
   185     </xsl:for-each>
       
   186   </xsl:template>
       
   187   <xsl:template match="*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:string">
       
   188     <xsl:param name="_indent" select="0"/>
       
   189     <xsl:variable name="name">
       
   190       <xsl:text>STRING</xsl:text>
       
   191     </xsl:variable>
       
   192     <xsl:value-of select="ns:SetType($name)"/>
       
   193   </xsl:template>
       
   194   <xsl:template match="*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:wstring">
       
   195     <xsl:param name="_indent" select="0"/>
       
   196     <xsl:variable name="name">
       
   197       <xsl:text>WSTRING</xsl:text>
       
   198     </xsl:variable>
       
   199     <xsl:value-of select="ns:SetType($name)"/>
       
   200   </xsl:template>
       
   201   <xsl:template match="*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/*">
       
   202     <xsl:param name="_indent" select="0"/>
       
   203     <xsl:variable name="name">
       
   204       <xsl:value-of select="local-name()"/>
       
   205     </xsl:variable>
       
   206     <xsl:value-of select="ns:SetType($name)"/>
       
   207   </xsl:template>
       
   208   <xsl:template mode="var_edit" match="*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:derived">
       
   209     <xsl:param name="_indent" select="0"/>
       
   210     <xsl:variable name="type_name" select="@name"/>
       
   211     <xsl:variable name="pou_infos">
       
   212       <xsl:copy-of select="exsl:node-set($project)/ppx:project/ppx:types/ppx:pous/ppx:pou[@name=$type_name] |&#10;                    exsl:node-set($stdlib)/ppx:project/ppx:types/ppx:pous/ppx:pou[@name=$type_name] |&#10;                    exsl:node-set($extensions)/ppx:project/ppx:types/ppx:pous/ppx:pou[@name=$type_name]"/>
       
   213     </xsl:variable>
       
   214     <xsl:choose>
       
   215       <xsl:when test="$pou_infos != ''">
       
   216         <xsl:text>false</xsl:text>
       
   217       </xsl:when>
       
   218       <xsl:otherwise>
       
   219         <xsl:text>true</xsl:text>
       
   220       </xsl:otherwise>
       
   221     </xsl:choose>
       
   222   </xsl:template>
       
   223   <xsl:template mode="var_edit" match="*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/*">
       
   224     <xsl:param name="_indent" select="0"/>
       
   225     <xsl:text>true</xsl:text>
       
   226   </xsl:template>
       
   227   <xsl:template match="ppx:value">
       
   228     <xsl:param name="_indent" select="0"/>
       
   229     <xsl:choose>
       
   230       <xsl:when test="@repetitionValue">
       
   231         <xsl:value-of select="@repetitionValue"/>
       
   232         <xsl:text>(</xsl:text>
       
   233         <xsl:apply-templates>
       
   234           <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/>
       
   235         </xsl:apply-templates>
       
   236         <xsl:text>)</xsl:text>
       
   237       </xsl:when>
       
   238       <xsl:when test="@member">
       
   239         <xsl:value-of select="@member"/>
       
   240         <xsl:text> := </xsl:text>
       
   241         <xsl:apply-templates>
       
   242           <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/>
       
   243         </xsl:apply-templates>
       
   244       </xsl:when>
       
   245       <xsl:otherwise>
       
   246         <xsl:apply-templates>
       
   247           <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/>
       
   248         </xsl:apply-templates>
       
   249       </xsl:otherwise>
       
   250     </xsl:choose>
       
   251   </xsl:template>
       
   252   <xsl:template match="ppx:simpleValue">
       
   253     <xsl:param name="_indent" select="0"/>
       
   254     <xsl:value-of select="@value"/>
       
   255   </xsl:template>
       
   256   <xsl:template name="complex_type_value">
       
   257     <xsl:param name="_indent" select="0"/>
       
   258     <xsl:param name="start_bracket"/>
       
   259     <xsl:param name="end_bracket"/>
       
   260     <xsl:value-of select="@start_bracket"/>
       
   261     <xsl:for-each select="ppx:value">
       
   262       <xsl:apply-templates select=".">
       
   263         <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/>
       
   264       </xsl:apply-templates>
       
   265       <xsl:choose>
       
   266         <xsl:when test="position()!=last()">
       
   267           <xsl:text>, </xsl:text>
       
   268         </xsl:when>
       
   269       </xsl:choose>
       
   270     </xsl:for-each>
       
   271     <xsl:value-of select="@end_bracket"/>
       
   272   </xsl:template>
       
   273   <xsl:template match="ppx:arrayValue">
       
   274     <xsl:param name="_indent" select="0"/>
       
   275     <xsl:call-template name="complex_type_value">
       
   276       <xsl:with-param name="start_bracket">
       
   277         <xsl:text>[</xsl:text>
       
   278       </xsl:with-param>
       
   279       <xsl:with-param name="end_bracket">
       
   280         <xsl:text>]</xsl:text>
       
   281       </xsl:with-param>
       
   282     </xsl:call-template>
       
   283   </xsl:template>
       
   284   <xsl:template match="ppx:structValue">
       
   285     <xsl:param name="_indent" select="0"/>
       
   286     <xsl:call-template name="complex_type_value">
       
   287       <xsl:with-param name="start_bracket">
       
   288         <xsl:text>(</xsl:text>
       
   289       </xsl:with-param>
       
   290       <xsl:with-param name="end_bracket">
       
   291         <xsl:text>)</xsl:text>
       
   292       </xsl:with-param>
       
   293     </xsl:call-template>
       
   294   </xsl:template>
       
   295 </xsl:stylesheet>