plcopen/variables_infos.ysl2
author Andrey Skvortsov <andrej.skvortzov@gmail.com>
Fri, 22 Apr 2016 16:59:47 +0300
changeset 1500 007588fb6549
parent 1368 e567e4bee11f
child 1936 b85b13b1c2ec
permissions -rw-r--r--
update Russian about Beremiz dialog window
1347
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
     1
include yslt.yml2
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
     2
estylesheet xmlns:ppx="http://www.plcopen.org/xml/tc6_0201"
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
     3
            xmlns:xhtml="http://www.w3.org/1999/xhtml"
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
     4
            xmlns:ns="var_infos_ns" 
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
     5
            extension-element-prefixes="ns" 
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
     6
            exclude-result-prefixes="ns" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
     7
    
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
     8
    param "tree";
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
     9
    
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    10
    template "text()";
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    11
    
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    12
    variable "project" {
1368
e567e4bee11f Fixed bugs with pou variable infos computation stylesheet
Laurent Bessard
parents: 1361
diff changeset
    13
        copy "document('project')/project/*";
1347
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    14
    }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    15
    
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    16
    variable "stdlib" {
1368
e567e4bee11f Fixed bugs with pou variable infos computation stylesheet
Laurent Bessard
parents: 1361
diff changeset
    17
        copy "document('stdlib')/stdlib/*";
1347
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    18
    }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    19
    variable "extensions" {
1368
e567e4bee11f Fixed bugs with pou variable infos computation stylesheet
Laurent Bessard
parents: 1361
diff changeset
    20
        copy "document('extensions')/extensions/*";
1347
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    21
    }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    22
    
1361
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
    23
    template "ppx:configuration" {
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
    24
        apply "ppx:globalVars";
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
    25
    }
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
    26
    
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
    27
    template "ppx:resource" {
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
    28
        apply "ppx:globalVars";
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
    29
    }
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
    30
    
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
    31
    template "ppx:pou" {
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
    32
        apply "ppx:interface/*";
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
    33
    }
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
    34
    
1347
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    35
    template "ppx:returnType" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    36
        value "ns:AddTree()";
1361
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
    37
        apply ".", mode="var_type";
1347
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    38
    }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    39
    
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    40
    function "variables_infos" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    41
        param "var_class";
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    42
        variable "var_option" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    43
            choose {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    44
                when "@constant='true' or @constant='1'" > Constant
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    45
                when "@retain='true' or @retain='1'" > Retain
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    46
                when "@nonretain='true' or @nonretain='1'" > Non-Retain
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    47
            }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    48
        }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    49
        foreach "ppx:variable" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    50
            variable "initial_value" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    51
                apply "ppx:initialValue";
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    52
            }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    53
            variable "edit" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    54
                choose {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    55
                    when "$var_class='Global' or $var_class='External'" > true
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    56
                    otherwise {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    57
                        apply "ppx:type", mode="var_edit";
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    58
                    }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    59
                }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    60
            }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    61
            value "ns:AddTree()";
1361
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
    62
            apply "ppx:type", mode="var_type";
1347
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    63
            value "ns:AddVariable(@name, $var_class, $var_option, @address, $initial_value, $edit, ppx:documentation/xhtml:p/text())";
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    64
        }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    65
    }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    66
    
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    67
    template "ppx:localVars" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    68
        call "variables_infos" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    69
            with "var_class" > Local
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    70
        }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    71
    }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    72
    
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    73
    template "ppx:globalVars" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    74
        call "variables_infos" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    75
            with "var_class" > Global
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    76
        }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    77
    }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    78
    
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    79
    template "ppx:externalVars" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    80
        call "variables_infos" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    81
            with "var_class" > External
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    82
        }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    83
    }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    84
    
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    85
    template "ppx:tempVars" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    86
        call "variables_infos" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    87
            with "var_class" > Temp
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    88
        }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    89
    }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    90
    
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    91
    template "ppx:inputVars" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    92
        call "variables_infos" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    93
            with "var_class" > Input
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    94
        }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    95
    }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    96
    
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    97
    template "ppx:outputVars" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    98
        call "variables_infos" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    99
            with "var_class" > Output
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   100
        }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   101
    }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   102
    
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   103
    template "ppx:inOutVars" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   104
        call "variables_infos" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   105
            with "var_class" > InOut
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   106
        }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   107
    }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   108
    
1361
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   109
    template "ppx:pou", mode="var_type" {
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   110
        apply "ppx:interface/*[self::ppx:inputVars or self::ppx:inOutVars or self::ppx:outputVars]/ppx:variable", mode="var_type";
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   111
    }
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   112
    
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   113
    template "ppx:variable", mode="var_type" {
1347
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   114
        variable "name" > «@name»
1368
e567e4bee11f Fixed bugs with pou variable infos computation stylesheet
Laurent Bessard
parents: 1361
diff changeset
   115
        value "ns:AddTree()";
1361
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   116
        apply "ppx:type", mode="var_type";
1347
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   117
        value "ns:AddVarToTree($name)";
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   118
    }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   119
    
1361
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   120
    template "ppx:dataType", mode="var_type" {
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   121
        apply "ppx:baseType", mode="var_type";
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   122
    }
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   123
    
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   124
    template "*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:struct", mode="var_type" {
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   125
        apply "ppx:variable", mode="var_type";
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   126
    }
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   127
    
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   128
    template "*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:derived", mode="var_type" {
1347
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   129
        variable "type_name" > «@name»
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   130
        choose {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   131
            when "$tree='True'" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   132
                apply """exsl:node-set($project)/ppx:project/ppx:types/ppx:pous/ppx:pou[@name=$type_name] |
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   133
                         exsl:node-set($project)/ppx:project/ppx:types/ppx:dataTypes/ppx:dataType[@name=$type_name] |
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   134
                         exsl:node-set($stdlib)/ppx:project/ppx:types/ppx:pous/ppx:pou[@name=$type_name] |
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   135
                         exsl:node-set($stdlib)/ppx:project/ppx:types/ppx:dataTypes/ppx:dataType[@name=$type_name] |
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   136
                         exsl:node-set($extensions)/ppx:project/ppx:types/ppx:pous/ppx:pou[@name=$type_name] |
1361
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   137
                         exsl:node-set($extensions)/ppx:project/ppx:types/ppx:dataTypes/ppx:dataType[@name=$type_name]""", mode="var_type";
1347
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   138
            }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   139
        }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   140
        value "ns:SetType($type_name)";
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   141
    }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   142
     
1361
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   143
    template "*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:array", mode="var_type" {
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   144
        apply "ppx:baseType", mode="var_type";
1347
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   145
        foreach "ppx:dimension" {
1368
e567e4bee11f Fixed bugs with pou variable infos computation stylesheet
Laurent Bessard
parents: 1361
diff changeset
   146
            variable "lower" > «@lower»
e567e4bee11f Fixed bugs with pou variable infos computation stylesheet
Laurent Bessard
parents: 1361
diff changeset
   147
            variable "upper" > «@upper»
e567e4bee11f Fixed bugs with pou variable infos computation stylesheet
Laurent Bessard
parents: 1361
diff changeset
   148
            value "ns:AddDimension($lower, $upper)";
1347
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   149
        }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   150
    }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   151
    
1361
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   152
    template "*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:string", mode="var_type" {
1347
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   153
        variable "name" > STRING
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   154
        value "ns:SetType($name)";
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   155
    }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   156
    
1361
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   157
    template "*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:wstring", mode="var_type" {
1347
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   158
        variable "name" > WSTRING
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   159
        value "ns:SetType($name)";
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   160
    }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   161
    
1361
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   162
    template "*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/*", mode="var_type" {
1347
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   163
        variable "name" > «local-name()»
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   164
        value "ns:SetType($name)";
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   165
    }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   166
    
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   167
    template "*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:derived", mode="var_edit" {
1368
e567e4bee11f Fixed bugs with pou variable infos computation stylesheet
Laurent Bessard
parents: 1361
diff changeset
   168
        variable "type_name" > «@name»
1347
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   169
        variable "pou_infos" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   170
            copy """exsl:node-set($project)/ppx:project/ppx:types/ppx:pous/ppx:pou[@name=$type_name] |
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   171
                    exsl:node-set($stdlib)/ppx:project/ppx:types/ppx:pous/ppx:pou[@name=$type_name] |
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   172
                    exsl:node-set($extensions)/ppx:project/ppx:types/ppx:pous/ppx:pou[@name=$type_name]""";
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   173
        }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   174
        choose {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   175
            when "$pou_infos != ''" > false
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   176
            otherwise > true
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   177
        }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   178
    }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   179
    
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   180
    template "*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/*", mode="var_edit" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   181
        > true
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   182
    }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   183
    
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   184
    template "ppx:value" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   185
        choose {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   186
            when "@repetitionValue" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   187
                > «@repetitionValue»(
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   188
                apply;
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   189
                > )
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   190
            }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   191
            when "@member" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   192
                 > «@member» := 
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   193
                 apply;
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   194
            }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   195
            otherwise {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   196
                apply;
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   197
            }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   198
        }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   199
    }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   200
    
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   201
    template "ppx:simpleValue" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   202
        > «@value»
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   203
    }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   204
    
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   205
    function "complex_type_value" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   206
        param "start_bracket";
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   207
        param "end_bracket";
1359
cce13b237b07 Fixed bug when loading complex type variable initial value
Laurent Bessard
parents: 1347
diff changeset
   208
        > «$start_bracket»
1347
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   209
        foreach "ppx:value" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   210
            apply ".";
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   211
            choose {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   212
                when "position()!=last()" > , 
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   213
            }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   214
        }
1359
cce13b237b07 Fixed bug when loading complex type variable initial value
Laurent Bessard
parents: 1347
diff changeset
   215
        > «$end_bracket»
1347
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   216
    }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   217
    
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   218
    template "ppx:arrayValue" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   219
        call "complex_type_value" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   220
            with "start_bracket" > [
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   221
            with "end_bracket" > ]
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   222
        }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   223
    }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   224
    
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   225
    template "ppx:structValue" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   226
        call "complex_type_value" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   227
            with "start_bracket" > (
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   228
            with "end_bracket" > )
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   229
        }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   230
    }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   231
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   232
}
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   233
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   234
    
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   235