plcopen/variables_infos.ysl2
author Edouard Tisserant <edouard.tisserant@gmail.com>
Mon, 16 Oct 2023 23:50:58 +0200
changeset 3868 e9807c28a788
parent 3802 8616ffd7c29d
permissions -rw-r--r--
Fix template conflict in XSLT with lxml>=4.9.0 again

Earlier attempt was fixing conflict with -1.0 priority attribute,
as a side effect of such low priority, SFC Actions were not
editable anymore.

This time move template around instead of using explicit priority.
1936
b85b13b1c2ec YSLT auto indent trick is useless here, added yslt_noindent.yml2, regenerated XSLT files
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 1368
diff changeset
     1
include yslt_noindent.yml2
b85b13b1c2ec YSLT auto indent trick is useless here, added yslt_noindent.yml2, regenerated XSLT files
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 1368
diff changeset
     2
istylesheet xmlns:ppx="http://www.plcopen.org/xml/tc6_0201"
1347
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
     3
            xmlns:xhtml="http://www.w3.org/1999/xhtml"
1951
bbd1e1744c91 GetVariableDictionary and GetPouInterfaceReturnType optimized with new VariableInfoCollector based on XSLTModelQuery. Moved corresponding definitions out of PLCControler.py.
Edouard Tisserant
parents: 1936
diff changeset
     4
            xmlns:ns="beremiz" 
1347
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
    
1951
bbd1e1744c91 GetVariableDictionary and GetPouInterfaceReturnType optimized with new VariableInfoCollector based on XSLTModelQuery. Moved corresponding definitions out of PLCControler.py.
Edouard Tisserant
parents: 1936
diff changeset
    12
    variable "project", "ns:GetProject()";
bbd1e1744c91 GetVariableDictionary and GetPouInterfaceReturnType optimized with new VariableInfoCollector based on XSLTModelQuery. Moved corresponding definitions out of PLCControler.py.
Edouard Tisserant
parents: 1936
diff changeset
    13
    
bbd1e1744c91 GetVariableDictionary and GetPouInterfaceReturnType optimized with new VariableInfoCollector based on XSLTModelQuery. Moved corresponding definitions out of PLCControler.py.
Edouard Tisserant
parents: 1936
diff changeset
    14
    variable "stdlib", "ns:GetStdLibs()";
bbd1e1744c91 GetVariableDictionary and GetPouInterfaceReturnType optimized with new VariableInfoCollector based on XSLTModelQuery. Moved corresponding definitions out of PLCControler.py.
Edouard Tisserant
parents: 1936
diff changeset
    15
bbd1e1744c91 GetVariableDictionary and GetPouInterfaceReturnType optimized with new VariableInfoCollector based on XSLTModelQuery. Moved corresponding definitions out of PLCControler.py.
Edouard Tisserant
parents: 1936
diff changeset
    16
    variable "extensions", "ns:GetExtensions()";
bbd1e1744c91 GetVariableDictionary and GetPouInterfaceReturnType optimized with new VariableInfoCollector based on XSLTModelQuery. Moved corresponding definitions out of PLCControler.py.
Edouard Tisserant
parents: 1936
diff changeset
    17
bbd1e1744c91 GetVariableDictionary and GetPouInterfaceReturnType optimized with new VariableInfoCollector based on XSLTModelQuery. Moved corresponding definitions out of PLCControler.py.
Edouard Tisserant
parents: 1936
diff changeset
    18
    variable "all_types", "($project | $stdlib | $extensions)/ppx:types";
bbd1e1744c91 GetVariableDictionary and GetPouInterfaceReturnType optimized with new VariableInfoCollector based on XSLTModelQuery. Moved corresponding definitions out of PLCControler.py.
Edouard Tisserant
parents: 1936
diff changeset
    19
1361
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
    20
    template "ppx:configuration" {
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
    21
        apply "ppx:globalVars";
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
    22
    }
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
    23
    
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
    24
    template "ppx:resource" {
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
    25
        apply "ppx:globalVars";
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
    
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
    28
    template "ppx:pou" {
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
    29
        apply "ppx:interface/*";
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
    
1347
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    32
    template "ppx:returnType" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    33
        value "ns:AddTree()";
1361
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
    34
        apply ".", mode="var_type";
1347
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    35
    }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    36
    
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    37
    function "variables_infos" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    38
        param "var_class";
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    39
        variable "var_option" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    40
            choose {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    41
                when "@constant='true' or @constant='1'" > Constant
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    42
                when "@retain='true' or @retain='1'" > Retain
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    43
                when "@nonretain='true' or @nonretain='1'" > Non-Retain
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    44
            }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    45
        }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    46
        foreach "ppx:variable" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    47
            variable "initial_value" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    48
                apply "ppx:initialValue";
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    49
            }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    50
            variable "edit" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    51
                choose {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    52
                    when "$var_class='Global' or $var_class='External'" > true
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    53
                    otherwise {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    54
                        apply "ppx:type", mode="var_edit";
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    55
                    }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    56
                }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    57
            }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    58
            value "ns:AddTree()";
1361
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
    59
            apply "ppx:type", mode="var_type";
1347
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    60
            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
    61
        }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    62
    }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    63
    
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    64
    template "ppx:localVars" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    65
        call "variables_infos" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    66
            with "var_class" > Local
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    67
        }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    68
    }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    69
    
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    70
    template "ppx:globalVars" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    71
        call "variables_infos" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    72
            with "var_class" > Global
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    73
        }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    74
    }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    75
    
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    76
    template "ppx:externalVars" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    77
        call "variables_infos" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    78
            with "var_class" > External
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    79
        }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    80
    }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    81
    
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    82
    template "ppx:tempVars" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    83
        call "variables_infos" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    84
            with "var_class" > Temp
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    85
        }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    86
    }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    87
    
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    88
    template "ppx:inputVars" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    89
        call "variables_infos" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    90
            with "var_class" > Input
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    91
        }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    92
    }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    93
    
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    94
    template "ppx:outputVars" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    95
        call "variables_infos" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    96
            with "var_class" > Output
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    97
        }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    98
    }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
    99
    
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   100
    template "ppx:inOutVars" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   101
        call "variables_infos" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   102
            with "var_class" > InOut
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   103
        }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   104
    }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   105
    
1361
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   106
    template "ppx:pou", mode="var_type" {
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   107
        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
   108
    }
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   109
    
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   110
    template "ppx:variable", mode="var_type" {
1347
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   111
        variable "name" > «@name»
1368
e567e4bee11f Fixed bugs with pou variable infos computation stylesheet
Laurent Bessard
parents: 1361
diff changeset
   112
        value "ns:AddTree()";
1361
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   113
        apply "ppx:type", mode="var_type";
1347
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   114
        value "ns:AddVarToTree($name)";
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   115
    }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   116
    
1361
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   117
    template "ppx:dataType", mode="var_type" {
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   118
        apply "ppx:baseType", mode="var_type";
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   119
    }
3868
e9807c28a788 Fix template conflict in XSLT with lxml>=4.9.0 again
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3802
diff changeset
   120
e9807c28a788 Fix template conflict in XSLT with lxml>=4.9.0 again
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3802
diff changeset
   121
    template "*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/*", mode="var_type" {
e9807c28a788 Fix template conflict in XSLT with lxml>=4.9.0 again
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3802
diff changeset
   122
        variable "name" > «local-name()»
e9807c28a788 Fix template conflict in XSLT with lxml>=4.9.0 again
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3802
diff changeset
   123
        value "ns:SetType($name)";
e9807c28a788 Fix template conflict in XSLT with lxml>=4.9.0 again
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3802
diff changeset
   124
    }
1361
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   125
    
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   126
    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
   127
        apply "ppx:variable", mode="var_type";
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   128
    }
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   129
    
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   130
    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
   131
        variable "type_name" > «@name»
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   132
        choose {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   133
            when "$tree='True'" {
1951
bbd1e1744c91 GetVariableDictionary and GetPouInterfaceReturnType optimized with new VariableInfoCollector based on XSLTModelQuery. Moved corresponding definitions out of PLCControler.py.
Edouard Tisserant
parents: 1936
diff changeset
   134
                apply """$all_types/ppx:pous/ppx:pou[@name=$type_name] | \
bbd1e1744c91 GetVariableDictionary and GetPouInterfaceReturnType optimized with new VariableInfoCollector based on XSLTModelQuery. Moved corresponding definitions out of PLCControler.py.
Edouard Tisserant
parents: 1936
diff changeset
   135
                         $all_types/ppx:dataTypes/ppx:dataType[@name=$type_name]""", mode="var_type";
1347
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   136
            }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   137
        }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   138
        value "ns:SetType($type_name)";
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
     
1361
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   141
    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
   142
        apply "ppx:baseType", mode="var_type";
1347
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   143
        foreach "ppx:dimension" {
1368
e567e4bee11f Fixed bugs with pou variable infos computation stylesheet
Laurent Bessard
parents: 1361
diff changeset
   144
            variable "lower" > «@lower»
e567e4bee11f Fixed bugs with pou variable infos computation stylesheet
Laurent Bessard
parents: 1361
diff changeset
   145
            variable "upper" > «@upper»
e567e4bee11f Fixed bugs with pou variable infos computation stylesheet
Laurent Bessard
parents: 1361
diff changeset
   146
            value "ns:AddDimension($lower, $upper)";
1347
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   147
        }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   148
    }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   149
    
1361
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   150
    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
   151
        variable "name" > STRING
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   152
        value "ns:SetType($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:wstring", mode="var_type" {
1347
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   156
        variable "name" > WSTRING
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   157
        value "ns:SetType($name)";
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   158
    }
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
    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
   162
        variable "type_name" > «@name»
1951
bbd1e1744c91 GetVariableDictionary and GetPouInterfaceReturnType optimized with new VariableInfoCollector based on XSLTModelQuery. Moved corresponding definitions out of PLCControler.py.
Edouard Tisserant
parents: 1936
diff changeset
   163
        variable "pou_infos", "$all_types/ppx:pous/ppx:pou[@name=$type_name]";
1347
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   164
        choose {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   165
            when "$pou_infos != ''" > false
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   166
            otherwise > true
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   167
        }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   168
    }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   169
    
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   170
    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
   171
        > true
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   172
    }
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
    template "ppx:value" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   175
        choose {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   176
            when "@repetitionValue" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   177
                > «@repetitionValue»(
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   178
                apply;
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
            }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   181
            when "@member" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   182
                 > «@member» := 
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   183
                 apply;
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   184
            }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   185
            otherwise {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   186
                apply;
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
    
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   191
    template "ppx:simpleValue" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   192
        > «@value»
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
    
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   195
    function "complex_type_value" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   196
        param "start_bracket";
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   197
        param "end_bracket";
1359
cce13b237b07 Fixed bug when loading complex type variable initial value
Laurent Bessard
parents: 1347
diff changeset
   198
        > «$start_bracket»
1347
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   199
        foreach "ppx:value" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   200
            apply ".";
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   201
            choose {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   202
                when "position()!=last()" > , 
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
        }
1359
cce13b237b07 Fixed bug when loading complex type variable initial value
Laurent Bessard
parents: 1347
diff changeset
   205
        > «$end_bracket»
1347
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   206
    }
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
    template "ppx:arrayValue" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   209
        call "complex_type_value" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   210
            with "start_bracket" > [
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   211
            with "end_bracket" > ]
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   212
        }
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
    template "ppx:structValue" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   216
        call "complex_type_value" {
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   217
            with "start_bracket" > (
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   218
            with "end_bracket" > )
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   219
        }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   220
    }
533741e5075c Fixed pou variables information loading stylesheet
Laurent Bessard
parents:
diff changeset
   221
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
    
1936
b85b13b1c2ec YSLT auto indent trick is useless here, added yslt_noindent.yml2, regenerated XSLT files
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 1368
diff changeset
   225