plcopen/variables_infos.ysl2
author Laurent Bessard
Fri, 11 Oct 2013 12:10:40 +0200
changeset 1361 7158aa054226
parent 1359 cce13b237b07
child 1368 e567e4bee11f
permissions -rw-r--r--
Fixed bugs when editing resource variables and tasks
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" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    13
        choose {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    14
            when "$tree='True'" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    15
                copy "document('project')/project/*";
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    16
            }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    17
        }
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
    
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    20
    variable "stdlib" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    21
        choose {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    22
            when "$tree='True'" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    23
                copy "document('stdlib')/stdlib/*";
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    24
            }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    25
        }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    26
    }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    27
    variable "extensions" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    28
        choose {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    29
            when "$tree='True'" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    30
                copy "document('extensions')/extensions/*";
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    31
            }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    32
        }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    33
    }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    34
    
1361
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
    35
    template "ppx:configuration" {
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
    36
        apply "ppx:globalVars";
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
    37
    }
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
    38
    
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
    39
    template "ppx:resource" {
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
    40
        apply "ppx:globalVars";
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
    41
    }
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
    42
    
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
    43
    template "ppx:pou" {
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
    44
        apply "ppx:interface/*";
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
    45
    }
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
    46
    
1347
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    47
    template "ppx:returnType" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    48
        value "ns:AddTree()";
1361
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
    49
        apply ".", mode="var_type";
1347
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    50
    }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    51
    
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    52
    function "variables_infos" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    53
        param "var_class";
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    54
        variable "var_option" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    55
            choose {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    56
                when "@constant='true' or @constant='1'" > Constant
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    57
                when "@retain='true' or @retain='1'" > Retain
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    58
                when "@nonretain='true' or @nonretain='1'" > Non-Retain
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
        foreach "ppx:variable" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    62
            variable "initial_value" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    63
                apply "ppx:initialValue";
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
            variable "edit" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    66
                choose {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    67
                    when "$var_class='Global' or $var_class='External'" > true
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    68
                    otherwise {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    69
                        apply "ppx:type", mode="var_edit";
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
            value "ns:AddTree()";
1361
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
    74
            apply "ppx:type", mode="var_type";
1347
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    75
            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
    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:localVars" {
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" > Local
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:globalVars" {
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" > Global
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:externalVars" {
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" > External
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:tempVars" {
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" > Temp
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:inputVars" {
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" > Input
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
    
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   109
    template "ppx:outputVars" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   110
        call "variables_infos" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   111
            with "var_class" > Output
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   112
        }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   113
    }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   114
    
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   115
    template "ppx:inOutVars" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   116
        call "variables_infos" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   117
            with "var_class" > InOut
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
    }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   120
    
1361
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   121
    template "ppx:pou", mode="var_type" {
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   122
        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
   123
    }
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   124
    
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   125
    template "ppx:variable", mode="var_type" {
1347
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   126
        variable "name" > «@name»
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   127
        value "ns:AddTree($name)";
1361
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   128
        apply "ppx:type", mode="var_type";
1347
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   129
        value "ns:AddVarToTree($name)";
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   130
    }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   131
    
1361
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   132
    template "ppx:dataType", mode="var_type" {
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   133
        apply "ppx:baseType", mode="var_type";
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   134
    }
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   135
    
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   136
    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
   137
        apply "ppx:variable", mode="var_type";
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   138
    }
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   139
    
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   140
    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
   141
        variable "type_name" > «@name»
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   142
        choose {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   143
            when "$tree='True'" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   144
                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
   145
                         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
   146
                         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
   147
                         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
   148
                         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
   149
                         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
   150
            }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   151
        }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   152
        value "ns:SetType($type_name)";
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   153
    }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   154
     
1361
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   155
    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
   156
        apply "ppx:baseType", mode="var_type";
1347
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   157
        foreach "ppx:dimension" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   158
            value "ns:AddDimension(@lower, @upper)";
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   159
        }
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]/ppx:string", mode="var_type" {
1347
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   163
        variable "name" > STRING
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
    
1361
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   167
    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
   168
        variable "name" > WSTRING
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   169
        value "ns:SetType($name)";
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   170
    }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   171
    
1361
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   172
    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
   173
        variable "name" > «local-name()»
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   174
        value "ns:SetType($name)";
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   175
    }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   176
    
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   177
    template "*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:derived", mode="var_edit" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   178
        variable "type_name", "@name";
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   179
        variable "pou_infos" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   180
            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
   181
                    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
   182
                    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
   183
        }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   184
        choose {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   185
            when "$pou_infos != ''" > false
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   186
            otherwise > true
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   187
        }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   188
    }
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
    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
   191
        > true
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   192
    }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   193
    
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   194
    template "ppx:value" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   195
        choose {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   196
            when "@repetitionValue" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   197
                > «@repetitionValue»(
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   198
                apply;
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
            when "@member" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   202
                 > «@member» := 
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   203
                 apply;
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
            otherwise {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   206
                apply;
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   207
            }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   208
        }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   209
    }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   210
    
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   211
    template "ppx:simpleValue" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   212
        > «@value»
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
    
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   215
    function "complex_type_value" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   216
        param "start_bracket";
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   217
        param "end_bracket";
1359
cce13b237b07 Fixed bug when loading complex type variable initial value
Laurent Bessard
parents: 1347
diff changeset
   218
        > «$start_bracket»
1347
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   219
        foreach "ppx:value" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   220
            apply ".";
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   221
            choose {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   222
                when "position()!=last()" > , 
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
        }
1359
cce13b237b07 Fixed bug when loading complex type variable initial value
Laurent Bessard
parents: 1347
diff changeset
   225
        > «$end_bracket»
1347
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   226
    }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   227
    
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   228
    template "ppx:arrayValue" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   229
        call "complex_type_value" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   230
            with "start_bracket" > [
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   231
            with "end_bracket" > ]
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
    template "ppx:structValue" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   236
        call "complex_type_value" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   237
            with "start_bracket" > (
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   238
            with "end_bracket" > )
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   239
        }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   240
    }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   241
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   242
}
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   243
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   244
    
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   245