plcopen/pou_variables.xslt
changeset 1936 b85b13b1c2ec
parent 1348 aee0a7eb833a
child 1943 9dc0e38552b2
equal deleted inserted replaced
1935:f2b0d849ea77 1936:b85b13b1c2ec
     1 <?xml version="1.0"?>
     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="pou_vars_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">
     2 <xsl:stylesheet xmlns:exsl="http://exslt.org/common" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:ppx="http://www.plcopen.org/xml/tc6_0201" xmlns:ns="pou_vars_ns" 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"/>
     3   <xsl:output method="xml"/>
     4   <xsl:variable name="space" select="'                                                                                                                                                                                                        '"/>
     4   <xsl:template match="text()"/>
     5   <xsl:param name="autoindent" select="4"/>
     5   <xsl:template mode="var_class" match="text()"/>
     6   <xsl:template match="text()">
     6   <xsl:template mode="var_type" match="text()"/>
     7     <xsl:param name="_indent" select="0"/>
     7   <xsl:template mode="var_edit" match="text()"/>
     8   </xsl:template>
     8   <xsl:template mode="var_debug" match="text()"/>
     9   <xsl:template mode="var_class" match="text()">
       
    10     <xsl:param name="_indent" select="0"/>
       
    11   </xsl:template>
       
    12   <xsl:template mode="var_type" match="text()">
       
    13     <xsl:param name="_indent" select="0"/>
       
    14   </xsl:template>
       
    15   <xsl:template mode="var_edit" match="text()">
       
    16     <xsl:param name="_indent" select="0"/>
       
    17   </xsl:template>
       
    18   <xsl:template mode="var_debug" match="text()">
       
    19     <xsl:param name="_indent" select="0"/>
       
    20   </xsl:template>
       
    21   <xsl:variable name="project">
     9   <xsl:variable name="project">
    22     <xsl:copy-of select="document('project')/project/*"/>
    10     <xsl:copy-of select="document('project')/project/*"/>
    23   </xsl:variable>
    11   </xsl:variable>
    24   <xsl:variable name="stdlib">
    12   <xsl:variable name="stdlib">
    25     <xsl:copy-of select="document('stdlib')/stdlib/*"/>
    13     <xsl:copy-of select="document('stdlib')/stdlib/*"/>
    26   </xsl:variable>
    14   </xsl:variable>
    27   <xsl:variable name="extensions">
    15   <xsl:variable name="extensions">
    28     <xsl:copy-of select="document('extensions')/extensions/*"/>
    16     <xsl:copy-of select="document('extensions')/extensions/*"/>
    29   </xsl:variable>
    17   </xsl:variable>
    30   <xsl:template name="add_root">
    18   <xsl:template name="add_root">
    31     <xsl:param name="_indent" select="0"/>
       
    32     <xsl:param name="class"/>
    19     <xsl:param name="class"/>
    33     <xsl:param name="type"/>
    20     <xsl:param name="type"/>
    34     <xsl:param name="edit">
    21     <xsl:param name="edit">
    35       <xsl:text>true</xsl:text>
    22       <xsl:text>true</xsl:text>
    36     </xsl:param>
    23     </xsl:param>
    38       <xsl:text>true</xsl:text>
    25       <xsl:text>true</xsl:text>
    39     </xsl:param>
    26     </xsl:param>
    40     <xsl:value-of select="ns:SetRoot($class, $type, $edit, $debug)"/>
    27     <xsl:value-of select="ns:SetRoot($class, $type, $edit, $debug)"/>
    41   </xsl:template>
    28   </xsl:template>
    42   <xsl:template match="ppx:pou">
    29   <xsl:template match="ppx:pou">
    43     <xsl:param name="_indent" select="0"/>
       
    44     <xsl:call-template name="add_root">
    30     <xsl:call-template name="add_root">
    45       <xsl:with-param name="class">
    31       <xsl:with-param name="class">
    46         <xsl:value-of select="@pouType"/>
    32         <xsl:value-of select="@pouType"/>
    47       </xsl:with-param>
    33       </xsl:with-param>
    48       <xsl:with-param name="type">
    34       <xsl:with-param name="type">
    49         <xsl:value-of select="@name"/>
    35         <xsl:value-of select="@name"/>
    50       </xsl:with-param>
    36       </xsl:with-param>
    51     </xsl:call-template>
    37     </xsl:call-template>
    52     <xsl:apply-templates select="ppx:interface">
    38     <xsl:apply-templates select="ppx:interface"/>
    53       <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/>
    39     <xsl:apply-templates mode="variable_list" select="ppx:actions/ppx:action | ppx:transitions/ppx:transition"/>
    54     </xsl:apply-templates>
       
    55     <xsl:apply-templates mode="variable_list" select="ppx:actions/ppx:action | ppx:transitions/ppx:transition">
       
    56       <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/>
       
    57     </xsl:apply-templates>
       
    58   </xsl:template>
    40   </xsl:template>
    59   <xsl:template match="ppx:action">
    41   <xsl:template match="ppx:action">
    60     <xsl:param name="_indent" select="0"/>
       
    61     <xsl:call-template name="add_root">
    42     <xsl:call-template name="add_root">
    62       <xsl:with-param name="class">
    43       <xsl:with-param name="class">
    63         <xsl:text>action</xsl:text>
    44         <xsl:text>action</xsl:text>
    64       </xsl:with-param>
    45       </xsl:with-param>
    65     </xsl:call-template>
    46     </xsl:call-template>
    66     <xsl:apply-templates select="ancestor::ppx:pou/child::ppx:interface">
    47     <xsl:apply-templates select="ancestor::ppx:pou/child::ppx:interface"/>
    67       <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/>
       
    68     </xsl:apply-templates>
       
    69   </xsl:template>
    48   </xsl:template>
    70   <xsl:template match="ppx:transition">
    49   <xsl:template match="ppx:transition">
    71     <xsl:param name="_indent" select="0"/>
       
    72     <xsl:call-template name="add_root">
    50     <xsl:call-template name="add_root">
    73       <xsl:with-param name="class">
    51       <xsl:with-param name="class">
    74         <xsl:text>transition</xsl:text>
    52         <xsl:text>transition</xsl:text>
    75       </xsl:with-param>
    53       </xsl:with-param>
    76     </xsl:call-template>
    54     </xsl:call-template>
    77     <xsl:apply-templates select="ancestor::ppx:pou/child::ppx:interface">
    55     <xsl:apply-templates select="ancestor::ppx:pou/child::ppx:interface"/>
    78       <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/>
       
    79     </xsl:apply-templates>
       
    80   </xsl:template>
    56   </xsl:template>
    81   <xsl:template match="ppx:configuration">
    57   <xsl:template match="ppx:configuration">
    82     <xsl:param name="_indent" select="0"/>
       
    83     <xsl:call-template name="add_root">
    58     <xsl:call-template name="add_root">
    84       <xsl:with-param name="class">
    59       <xsl:with-param name="class">
    85         <xsl:text>configuration</xsl:text>
    60         <xsl:text>configuration</xsl:text>
    86       </xsl:with-param>
    61       </xsl:with-param>
    87       <xsl:with-param name="debug">
    62       <xsl:with-param name="debug">
    88         <xsl:text>false</xsl:text>
    63         <xsl:text>false</xsl:text>
    89       </xsl:with-param>
    64       </xsl:with-param>
    90     </xsl:call-template>
    65     </xsl:call-template>
    91     <xsl:apply-templates mode="variable_list" select="ppx:resource">
    66     <xsl:apply-templates mode="variable_list" select="ppx:resource"/>
    92       <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/>
    67     <xsl:apply-templates select="ppx:globalVars"/>
    93     </xsl:apply-templates>
       
    94     <xsl:apply-templates select="ppx:globalVars">
       
    95       <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/>
       
    96     </xsl:apply-templates>
       
    97   </xsl:template>
    68   </xsl:template>
    98   <xsl:template match="ppx:resource">
    69   <xsl:template match="ppx:resource">
    99     <xsl:param name="_indent" select="0"/>
       
   100     <xsl:call-template name="add_root">
    70     <xsl:call-template name="add_root">
   101       <xsl:with-param name="class">
    71       <xsl:with-param name="class">
   102         <xsl:text>resource</xsl:text>
    72         <xsl:text>resource</xsl:text>
   103       </xsl:with-param>
    73       </xsl:with-param>
   104       <xsl:with-param name="debug">
    74       <xsl:with-param name="debug">
   105         <xsl:text>false</xsl:text>
    75         <xsl:text>false</xsl:text>
   106       </xsl:with-param>
    76       </xsl:with-param>
   107     </xsl:call-template>
    77     </xsl:call-template>
   108     <xsl:apply-templates mode="variable_list" select="ppx:pouInstance | ppx:task/ppx:pouInstance">
    78     <xsl:apply-templates mode="variable_list" select="ppx:pouInstance | ppx:task/ppx:pouInstance"/>
   109       <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/>
    79     <xsl:apply-templates select="ppx:globalVars"/>
   110     </xsl:apply-templates>
       
   111     <xsl:apply-templates select="ppx:globalVars">
       
   112       <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/>
       
   113     </xsl:apply-templates>
       
   114   </xsl:template>
    80   </xsl:template>
   115   <xsl:template name="variables_infos">
    81   <xsl:template name="variables_infos">
   116     <xsl:param name="_indent" select="0"/>
       
   117     <xsl:param name="var_class"/>
    82     <xsl:param name="var_class"/>
   118     <xsl:for-each select="ppx:variable">
    83     <xsl:for-each select="ppx:variable">
   119       <xsl:variable name="class">
    84       <xsl:variable name="class">
   120         <xsl:apply-templates mode="var_class" select="ppx:type">
    85         <xsl:apply-templates mode="var_class" select="ppx:type">
   121           <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/>
       
   122           <xsl:with-param name="default_class">
    86           <xsl:with-param name="default_class">
   123             <xsl:value-of select="$var_class"/>
    87             <xsl:value-of select="$var_class"/>
   124           </xsl:with-param>
    88           </xsl:with-param>
   125         </xsl:apply-templates>
    89         </xsl:apply-templates>
   126       </xsl:variable>
    90       </xsl:variable>
   127       <xsl:variable name="type">
    91       <xsl:variable name="type">
   128         <xsl:apply-templates mode="var_type" select="ppx:type">
    92         <xsl:apply-templates mode="var_type" select="ppx:type"/>
   129           <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/>
       
   130         </xsl:apply-templates>
       
   131       </xsl:variable>
    93       </xsl:variable>
   132       <xsl:variable name="edit">
    94       <xsl:variable name="edit">
   133         <xsl:apply-templates mode="var_edit" select="ppx:type">
    95         <xsl:apply-templates mode="var_edit" select="ppx:type"/>
   134           <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/>
       
   135         </xsl:apply-templates>
       
   136       </xsl:variable>
    96       </xsl:variable>
   137       <xsl:variable name="debug">
    97       <xsl:variable name="debug">
   138         <xsl:apply-templates mode="var_debug" select="ppx:type">
    98         <xsl:apply-templates mode="var_debug" select="ppx:type"/>
   139           <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/>
       
   140         </xsl:apply-templates>
       
   141       </xsl:variable>
    99       </xsl:variable>
   142       <xsl:value-of select="ns:AddVariable(@name, $class, $type, $edit, $debug)"/>
   100       <xsl:value-of select="ns:AddVariable(@name, $class, $type, $edit, $debug)"/>
   143     </xsl:for-each>
   101     </xsl:for-each>
   144   </xsl:template>
   102   </xsl:template>
   145   <xsl:template match="ppx:localVars">
   103   <xsl:template match="ppx:localVars">
   146     <xsl:param name="_indent" select="0"/>
       
   147     <xsl:call-template name="variables_infos">
   104     <xsl:call-template name="variables_infos">
   148       <xsl:with-param name="var_class">
   105       <xsl:with-param name="var_class">
   149         <xsl:text>Local</xsl:text>
   106         <xsl:text>Local</xsl:text>
   150       </xsl:with-param>
   107       </xsl:with-param>
   151     </xsl:call-template>
   108     </xsl:call-template>
   152   </xsl:template>
   109   </xsl:template>
   153   <xsl:template match="ppx:globalVars">
   110   <xsl:template match="ppx:globalVars">
   154     <xsl:param name="_indent" select="0"/>
       
   155     <xsl:call-template name="variables_infos">
   111     <xsl:call-template name="variables_infos">
   156       <xsl:with-param name="var_class">
   112       <xsl:with-param name="var_class">
   157         <xsl:text>Global</xsl:text>
   113         <xsl:text>Global</xsl:text>
   158       </xsl:with-param>
   114       </xsl:with-param>
   159     </xsl:call-template>
   115     </xsl:call-template>
   160   </xsl:template>
   116   </xsl:template>
   161   <xsl:template match="ppx:externalVars">
   117   <xsl:template match="ppx:externalVars">
   162     <xsl:param name="_indent" select="0"/>
       
   163     <xsl:call-template name="variables_infos">
   118     <xsl:call-template name="variables_infos">
   164       <xsl:with-param name="var_class">
   119       <xsl:with-param name="var_class">
   165         <xsl:text>External</xsl:text>
   120         <xsl:text>External</xsl:text>
   166       </xsl:with-param>
   121       </xsl:with-param>
   167     </xsl:call-template>
   122     </xsl:call-template>
   168   </xsl:template>
   123   </xsl:template>
   169   <xsl:template match="ppx:tempVars">
   124   <xsl:template match="ppx:tempVars">
   170     <xsl:param name="_indent" select="0"/>
       
   171     <xsl:call-template name="variables_infos">
   125     <xsl:call-template name="variables_infos">
   172       <xsl:with-param name="var_class">
   126       <xsl:with-param name="var_class">
   173         <xsl:text>Temp</xsl:text>
   127         <xsl:text>Temp</xsl:text>
   174       </xsl:with-param>
   128       </xsl:with-param>
   175     </xsl:call-template>
   129     </xsl:call-template>
   176   </xsl:template>
   130   </xsl:template>
   177   <xsl:template match="ppx:inputVars">
   131   <xsl:template match="ppx:inputVars">
   178     <xsl:param name="_indent" select="0"/>
       
   179     <xsl:call-template name="variables_infos">
   132     <xsl:call-template name="variables_infos">
   180       <xsl:with-param name="var_class">
   133       <xsl:with-param name="var_class">
   181         <xsl:text>Input</xsl:text>
   134         <xsl:text>Input</xsl:text>
   182       </xsl:with-param>
   135       </xsl:with-param>
   183     </xsl:call-template>
   136     </xsl:call-template>
   184   </xsl:template>
   137   </xsl:template>
   185   <xsl:template match="ppx:outputVars">
   138   <xsl:template match="ppx:outputVars">
   186     <xsl:param name="_indent" select="0"/>
       
   187     <xsl:call-template name="variables_infos">
   139     <xsl:call-template name="variables_infos">
   188       <xsl:with-param name="var_class">
   140       <xsl:with-param name="var_class">
   189         <xsl:text>Output</xsl:text>
   141         <xsl:text>Output</xsl:text>
   190       </xsl:with-param>
   142       </xsl:with-param>
   191     </xsl:call-template>
   143     </xsl:call-template>
   192   </xsl:template>
   144   </xsl:template>
   193   <xsl:template match="ppx:inOutVars">
   145   <xsl:template match="ppx:inOutVars">
   194     <xsl:param name="_indent" select="0"/>
       
   195     <xsl:call-template name="variables_infos">
   146     <xsl:call-template name="variables_infos">
   196       <xsl:with-param name="var_class">
   147       <xsl:with-param name="var_class">
   197         <xsl:text>InOut</xsl:text>
   148         <xsl:text>InOut</xsl:text>
   198       </xsl:with-param>
   149       </xsl:with-param>
   199     </xsl:call-template>
   150     </xsl:call-template>
   200   </xsl:template>
   151   </xsl:template>
   201   <xsl:template name="add_variable">
   152   <xsl:template name="add_variable">
   202     <xsl:param name="_indent" select="0"/>
       
   203     <xsl:param name="name"/>
   153     <xsl:param name="name"/>
   204     <xsl:param name="class"/>
   154     <xsl:param name="class"/>
   205     <xsl:param name="type"/>
   155     <xsl:param name="type"/>
   206     <xsl:param name="edit">
   156     <xsl:param name="edit">
   207       <xsl:text>true</xsl:text>
   157       <xsl:text>true</xsl:text>
   210       <xsl:text>true</xsl:text>
   160       <xsl:text>true</xsl:text>
   211     </xsl:param>
   161     </xsl:param>
   212     <xsl:value-of select="ns:AddVariable($name, $class, $type, $edit, $debug)"/>
   162     <xsl:value-of select="ns:AddVariable($name, $class, $type, $edit, $debug)"/>
   213   </xsl:template>
   163   </xsl:template>
   214   <xsl:template mode="variable_list" match="ppx:action">
   164   <xsl:template mode="variable_list" match="ppx:action">
   215     <xsl:param name="_indent" select="0"/>
       
   216     <xsl:call-template name="add_variable">
   165     <xsl:call-template name="add_variable">
   217       <xsl:with-param name="name">
   166       <xsl:with-param name="name">
   218         <xsl:value-of select="@name"/>
   167         <xsl:value-of select="@name"/>
   219       </xsl:with-param>
   168       </xsl:with-param>
   220       <xsl:with-param name="class">
   169       <xsl:with-param name="class">
   221         <xsl:text>action</xsl:text>
   170         <xsl:text>action</xsl:text>
   222       </xsl:with-param>
   171       </xsl:with-param>
   223     </xsl:call-template>
   172     </xsl:call-template>
   224   </xsl:template>
   173   </xsl:template>
   225   <xsl:template mode="variable_list" match="ppx:transition">
   174   <xsl:template mode="variable_list" match="ppx:transition">
   226     <xsl:param name="_indent" select="0"/>
       
   227     <xsl:call-template name="add_variable">
   175     <xsl:call-template name="add_variable">
   228       <xsl:with-param name="name">
   176       <xsl:with-param name="name">
   229         <xsl:value-of select="@name"/>
   177         <xsl:value-of select="@name"/>
   230       </xsl:with-param>
   178       </xsl:with-param>
   231       <xsl:with-param name="class">
   179       <xsl:with-param name="class">
   232         <xsl:text>transition</xsl:text>
   180         <xsl:text>transition</xsl:text>
   233       </xsl:with-param>
   181       </xsl:with-param>
   234     </xsl:call-template>
   182     </xsl:call-template>
   235   </xsl:template>
   183   </xsl:template>
   236   <xsl:template mode="variable_list" match="ppx:resource">
   184   <xsl:template mode="variable_list" match="ppx:resource">
   237     <xsl:param name="_indent" select="0"/>
       
   238     <xsl:call-template name="add_variable">
   185     <xsl:call-template name="add_variable">
   239       <xsl:with-param name="name">
   186       <xsl:with-param name="name">
   240         <xsl:value-of select="@name"/>
   187         <xsl:value-of select="@name"/>
   241       </xsl:with-param>
   188       </xsl:with-param>
   242       <xsl:with-param name="class">
   189       <xsl:with-param name="class">
   246         <xsl:text>false</xsl:text>
   193         <xsl:text>false</xsl:text>
   247       </xsl:with-param>
   194       </xsl:with-param>
   248     </xsl:call-template>
   195     </xsl:call-template>
   249   </xsl:template>
   196   </xsl:template>
   250   <xsl:template mode="variable_list" match="ppx:pouInstance">
   197   <xsl:template mode="variable_list" match="ppx:pouInstance">
   251     <xsl:param name="_indent" select="0"/>
       
   252     <xsl:call-template name="add_variable">
   198     <xsl:call-template name="add_variable">
   253       <xsl:with-param name="name">
   199       <xsl:with-param name="name">
   254         <xsl:value-of select="@name"/>
   200         <xsl:value-of select="@name"/>
   255       </xsl:with-param>
   201       </xsl:with-param>
   256       <xsl:with-param name="class">
   202       <xsl:with-param name="class">
   260         <xsl:value-of select="@typeName"/>
   206         <xsl:value-of select="@typeName"/>
   261       </xsl:with-param>
   207       </xsl:with-param>
   262     </xsl:call-template>
   208     </xsl:call-template>
   263   </xsl:template>
   209   </xsl:template>
   264   <xsl:template mode="var_class" match="*[self::ppx:type or self::ppx:baseType]/ppx:derived">
   210   <xsl:template mode="var_class" match="*[self::ppx:type or self::ppx:baseType]/ppx:derived">
   265     <xsl:param name="_indent" select="0"/>
       
   266     <xsl:param name="default_class"/>
   211     <xsl:param name="default_class"/>
   267     <xsl:variable name="type_name" select="@name"/>
   212     <xsl:variable name="type_name" select="@name"/>
   268     <xsl:variable name="pou_infos">
   213     <xsl:variable name="pou_infos">
   269       <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]"/>
   214       <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]"/>
   270     </xsl:variable>
   215     </xsl:variable>
   271     <xsl:choose>
   216     <xsl:choose>
   272       <xsl:when test="$pou_infos != ''">
   217       <xsl:when test="$pou_infos != ''">
   273         <xsl:apply-templates mode="var_class" select="exsl:node-set($pou_infos)">
   218         <xsl:apply-templates mode="var_class" select="exsl:node-set($pou_infos)"/>
   274           <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/>
       
   275         </xsl:apply-templates>
       
   276       </xsl:when>
   219       </xsl:when>
   277       <xsl:otherwise>
   220       <xsl:otherwise>
   278         <xsl:value-of select="$default_class"/>
   221         <xsl:value-of select="$default_class"/>
   279       </xsl:otherwise>
   222       </xsl:otherwise>
   280     </xsl:choose>
   223     </xsl:choose>
   281   </xsl:template>
   224   </xsl:template>
   282   <xsl:template mode="var_class" match="ppx:pou">
   225   <xsl:template mode="var_class" match="ppx:pou">
   283     <xsl:param name="_indent" select="0"/>
       
   284     <xsl:value-of select="@pouType"/>
   226     <xsl:value-of select="@pouType"/>
   285   </xsl:template>
   227   </xsl:template>
   286   <xsl:template mode="var_class" match="*[self::ppx:type or self::ppx:baseType]/*">
   228   <xsl:template mode="var_class" match="*[self::ppx:type or self::ppx:baseType]/*">
   287     <xsl:param name="_indent" select="0"/>
       
   288     <xsl:param name="default_class"/>
   229     <xsl:param name="default_class"/>
   289     <xsl:value-of select="$default_class"/>
   230     <xsl:value-of select="$default_class"/>
   290   </xsl:template>
   231   </xsl:template>
   291   <xsl:template mode="var_type" match="*[self::ppx:type or self::ppx:baseType]/ppx:derived">
   232   <xsl:template mode="var_type" match="*[self::ppx:type or self::ppx:baseType]/ppx:derived">
   292     <xsl:param name="_indent" select="0"/>
       
   293     <xsl:value-of select="@name"/>
   233     <xsl:value-of select="@name"/>
   294   </xsl:template>
   234   </xsl:template>
   295   <xsl:template mode="var_type" match="*[self::ppx:type or self::ppx:baseType]/ppx:array">
   235   <xsl:template mode="var_type" match="*[self::ppx:type or self::ppx:baseType]/ppx:array">
   296     <xsl:param name="_indent" select="0"/>
       
   297     <xsl:text>ARRAY [</xsl:text>
   236     <xsl:text>ARRAY [</xsl:text>
   298     <xsl:for-each select="ppx:dimension">
   237     <xsl:for-each select="ppx:dimension">
   299       <xsl:value-of select="@lower"/>
   238       <xsl:value-of select="@lower"/>
   300       <xsl:text>..</xsl:text>
   239       <xsl:text>..</xsl:text>
   301       <xsl:value-of select="@upper"/>
   240       <xsl:value-of select="@upper"/>
   302     </xsl:for-each>
   241     </xsl:for-each>
   303     <xsl:text>] OF </xsl:text>
   242     <xsl:text>] OF </xsl:text>
   304     <xsl:apply-templates mode="var_type" select="ppx:baseType">
   243     <xsl:apply-templates mode="var_type" select="ppx:baseType"/>
   305       <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/>
       
   306     </xsl:apply-templates>
       
   307   </xsl:template>
   244   </xsl:template>
   308   <xsl:template mode="var_type" match="*[self::ppx:type or self::ppx:baseType]/ppx:string">
   245   <xsl:template mode="var_type" match="*[self::ppx:type or self::ppx:baseType]/ppx:string">
   309     <xsl:param name="_indent" select="0"/>
       
   310     <xsl:text>STRING</xsl:text>
   246     <xsl:text>STRING</xsl:text>
   311   </xsl:template>
   247   </xsl:template>
   312   <xsl:template mode="var_type" match="*[self::ppx:type or self::ppx:baseType]/ppx:wstring">
   248   <xsl:template mode="var_type" match="*[self::ppx:type or self::ppx:baseType]/ppx:wstring">
   313     <xsl:param name="_indent" select="0"/>
       
   314     <xsl:text>WSTRING</xsl:text>
   249     <xsl:text>WSTRING</xsl:text>
   315   </xsl:template>
   250   </xsl:template>
   316   <xsl:template mode="var_type" match="*[self::ppx:type or self::ppx:baseType]/*">
   251   <xsl:template mode="var_type" match="*[self::ppx:type or self::ppx:baseType]/*">
   317     <xsl:param name="_indent" select="0"/>
       
   318     <xsl:value-of select="local-name()"/>
   252     <xsl:value-of select="local-name()"/>
   319   </xsl:template>
   253   </xsl:template>
   320   <xsl:template mode="var_edit" match="*[self::ppx:type or self::ppx:baseType]/ppx:derived">
   254   <xsl:template mode="var_edit" match="*[self::ppx:type or self::ppx:baseType]/ppx:derived">
   321     <xsl:param name="_indent" select="0"/>
       
   322     <xsl:variable name="type_name" select="@name"/>
   255     <xsl:variable name="type_name" select="@name"/>
   323     <xsl:variable name="pou_infos">
   256     <xsl:variable name="pou_infos">
   324       <xsl:copy-of select="exsl:node-set($project)/ppx:project/ppx:types/ppx:pous/ppx:pou[@name=$type_name]"/>
   257       <xsl:copy-of select="exsl:node-set($project)/ppx:project/ppx:types/ppx:pous/ppx:pou[@name=$type_name]"/>
   325     </xsl:variable>
   258     </xsl:variable>
   326     <xsl:choose>
   259     <xsl:choose>
   331         <xsl:text>false</xsl:text>
   264         <xsl:text>false</xsl:text>
   332       </xsl:otherwise>
   265       </xsl:otherwise>
   333     </xsl:choose>
   266     </xsl:choose>
   334   </xsl:template>
   267   </xsl:template>
   335   <xsl:template mode="var_edit" match="*[self::ppx:type or self::ppx:baseType]/ppx:array">
   268   <xsl:template mode="var_edit" match="*[self::ppx:type or self::ppx:baseType]/ppx:array">
   336     <xsl:param name="_indent" select="0"/>
   269     <xsl:apply-templates mode="var_edit" select="ppx:baseType"/>
   337     <xsl:apply-templates mode="var_edit" select="ppx:baseType">
       
   338       <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/>
       
   339     </xsl:apply-templates>
       
   340   </xsl:template>
   270   </xsl:template>
   341   <xsl:template mode="var_edit" match="*[self::ppx:type or self::ppx:baseType]/*">
   271   <xsl:template mode="var_edit" match="*[self::ppx:type or self::ppx:baseType]/*">
   342     <xsl:param name="_indent" select="0"/>
       
   343     <xsl:text>false</xsl:text>
   272     <xsl:text>false</xsl:text>
   344   </xsl:template>
   273   </xsl:template>
   345   <xsl:template mode="var_debug" match="*[self::ppx:type or self::ppx:baseType]/ppx:derived">
   274   <xsl:template mode="var_debug" match="*[self::ppx:type or self::ppx:baseType]/ppx:derived">
   346     <xsl:param name="_indent" select="0"/>
       
   347     <xsl:variable name="type_name" select="@name"/>
   275     <xsl:variable name="type_name" select="@name"/>
   348     <xsl:variable name="datatype_infos">
   276     <xsl:variable name="datatype_infos">
   349       <xsl:copy-of 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:dataTypes/ppx:dataType[@name=$type_name] |&#10;                    exsl:node-set($extensions)/ppx:project/ppx:types/ppx:dataTypes/ppx:dataType[@name=$type_name]"/>
   277       <xsl:copy-of 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:dataTypes/ppx:dataType[@name=$type_name] |&#10;                    exsl:node-set($extensions)/ppx:project/ppx:types/ppx:dataTypes/ppx:dataType[@name=$type_name]"/>
   350     </xsl:variable>
   278     </xsl:variable>
   351     <xsl:choose>
   279     <xsl:choose>
   352       <xsl:when test="$datatype_infos != ''">
   280       <xsl:when test="$datatype_infos != ''">
   353         <xsl:apply-templates mode="var_debug" select="exsl:node-set($datatype_infos)">
   281         <xsl:apply-templates mode="var_debug" select="exsl:node-set($datatype_infos)"/>
   354           <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/>
       
   355         </xsl:apply-templates>
       
   356       </xsl:when>
   282       </xsl:when>
   357       <xsl:otherwise>
   283       <xsl:otherwise>
   358         <xsl:text>false</xsl:text>
   284         <xsl:text>false</xsl:text>
   359       </xsl:otherwise>
   285       </xsl:otherwise>
   360     </xsl:choose>
   286     </xsl:choose>
   361   </xsl:template>
   287   </xsl:template>
   362   <xsl:template mode="var_debug" match="ppx:pou">
   288   <xsl:template mode="var_debug" match="ppx:pou">
   363     <xsl:param name="_indent" select="0"/>
       
   364     <xsl:text>true</xsl:text>
   289     <xsl:text>true</xsl:text>
   365   </xsl:template>
   290   </xsl:template>
   366   <xsl:template mode="var_debug" match="*[self::ppx:type or self::ppx:baseType]/ppx:array">
   291   <xsl:template mode="var_debug" match="*[self::ppx:type or self::ppx:baseType]/ppx:array">
   367     <xsl:param name="_indent" select="0"/>
       
   368     <xsl:text>false</xsl:text>
   292     <xsl:text>false</xsl:text>
   369   </xsl:template>
   293   </xsl:template>
   370   <xsl:template mode="var_debug" match="*[self::ppx:type or self::ppx:baseType]/ppx:struct">
   294   <xsl:template mode="var_debug" match="*[self::ppx:type or self::ppx:baseType]/ppx:struct">
   371     <xsl:param name="_indent" select="0"/>
       
   372     <xsl:text>false</xsl:text>
   295     <xsl:text>false</xsl:text>
   373   </xsl:template>
   296   </xsl:template>
   374   <xsl:template mode="var_debug" match="*[self::ppx:type or self::ppx:baseType]/*">
   297   <xsl:template mode="var_debug" match="*[self::ppx:type or self::ppx:baseType]/*">
   375     <xsl:param name="_indent" select="0"/>
       
   376     <xsl:text>true</xsl:text>
   298     <xsl:text>true</xsl:text>
   377   </xsl:template>
   299   </xsl:template>
   378 </xsl:stylesheet>
   300 </xsl:stylesheet>