plcopen/pou_variables.ysl2
author Edouard Tisserant
Fri, 06 May 2022 11:01:07 +0200
changeset 3467 d8b9ed779728
parent 1949 c266fbaae0f6
child 3802 8616ffd7c29d
permissions -rw-r--r--
SVGHMI: fix test/projects/svghmi "unspecified" frequency that was actualy specified...
1936
b85b13b1c2ec YSLT auto indent trick is useless here, added yslt_noindent.yml2, regenerated XSLT files
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 1348
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: 1348
diff changeset
     2
istylesheet xmlns:ppx="http://www.plcopen.org/xml/tc6_0201"
1348
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
     3
            xmlns:xhtml="http://www.w3.org/1999/xhtml"
1943
9dc0e38552b2 GetPouVariables optimized with XSLTModelQuery
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 1936
diff changeset
     4
            xmlns:ns="beremiz" 
1348
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
     5
            extension-element-prefixes="ns" 
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
     6
            exclude-result-prefixes="ns" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
     7
    
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
     8
    template "text()";
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
     9
    template "text()", mode="var_class";
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    10
    template "text()", mode="var_type";
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    11
    template "text()", mode="var_edit";
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    12
    template "text()", mode="var_debug";
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    13
    
1943
9dc0e38552b2 GetPouVariables optimized with XSLTModelQuery
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 1936
diff changeset
    14
    variable "project", "ns:GetProject()";
9dc0e38552b2 GetPouVariables optimized with XSLTModelQuery
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 1936
diff changeset
    15
    
9dc0e38552b2 GetPouVariables optimized with XSLTModelQuery
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 1936
diff changeset
    16
    variable "stdlib", "ns:GetStdLibs()";
9dc0e38552b2 GetPouVariables optimized with XSLTModelQuery
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 1936
diff changeset
    17
9dc0e38552b2 GetPouVariables optimized with XSLTModelQuery
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 1936
diff changeset
    18
    variable "extensions", "ns:GetExtensions()";
1945
90bf6bd94b94 Fixed earlier XSLT optimizations. Some/most results were missing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 1943
diff changeset
    19
1949
c266fbaae0f6 Better writing of some xpath added in previous commits about XSLT optimization.
Edouard Tisserant
parents: 1946
diff changeset
    20
    variable "all_types", "($project | $stdlib | $extensions)/ppx:types";
1348
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    21
    
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    22
    function "add_root" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    23
        param "class";
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    24
        param "type";
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    25
        param "edit" > true
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    26
        param "debug" > true
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    27
        value "ns:SetRoot($class, $type, $edit, $debug)";
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    28
    }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    29
    
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    30
    template "ppx:pou" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    31
        call "add_root" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    32
            with "class" > «@pouType»
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    33
            with "type" > «@name»
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    34
        }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    35
        apply "ppx:interface";
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    36
        apply "ppx:actions/ppx:action | ppx:transitions/ppx:transition", mode="variable_list";
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    37
    }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    38
    
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    39
    template "ppx:action" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    40
        call "add_root" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    41
            with "class" > action
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    42
        }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    43
        apply "ancestor::ppx:pou/child::ppx:interface";
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    44
    }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    45
    
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    46
    template "ppx:transition" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    47
        call "add_root" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    48
            with "class" > transition
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    49
        }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    50
        apply "ancestor::ppx:pou/child::ppx:interface";
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    51
    }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    52
    
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    53
    template "ppx:configuration" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    54
        call "add_root" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    55
            with "class" > configuration
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    56
            with "debug" > false
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    57
        }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    58
        apply "ppx:resource", mode="variable_list";
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    59
        apply "ppx:globalVars";
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    60
    }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    61
    
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    62
    template "ppx:resource" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    63
        call "add_root" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    64
            with "class" > resource
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    65
            with "debug" > false
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    66
        }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    67
        apply "ppx:pouInstance | ppx:task/ppx:pouInstance",  mode="variable_list";
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    68
        apply "ppx:globalVars";
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    69
    }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    70
    
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    71
    function "variables_infos" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    72
        param "var_class";
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    73
        foreach "ppx:variable" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    74
            variable "class" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    75
                apply "ppx:type", mode="var_class" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    76
                    with "default_class" > «$var_class»
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    77
                }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    78
            }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    79
            variable "type" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    80
                apply"ppx:type", mode="var_type";
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    81
            }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    82
            variable "edit" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    83
                apply "ppx:type", mode="var_edit";
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    84
            }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    85
            variable "debug" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    86
                apply "ppx:type", mode="var_debug";
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    87
            }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    88
            value "ns:AddVariable(@name, $class, $type, $edit, $debug)";
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    89
        }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    90
    }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    91
    
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    92
    template "ppx:localVars" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    93
        call "variables_infos" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    94
            with "var_class" > Local
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    95
        }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    96
    }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    97
    
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    98
    template "ppx:globalVars" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
    99
        call "variables_infos" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   100
            with "var_class" > Global
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   101
        }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   102
    }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   103
    
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   104
    template "ppx:externalVars" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   105
        call "variables_infos" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   106
            with "var_class" > External
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   107
        }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   108
    }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   109
    
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   110
    template "ppx:tempVars" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   111
        call "variables_infos" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   112
            with "var_class" > Temp
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   113
        }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   114
    }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   115
    
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   116
    template "ppx:inputVars" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   117
        call "variables_infos" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   118
            with "var_class" > Input
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   119
        }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   120
    }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   121
    
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   122
    template "ppx:outputVars" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   123
        call "variables_infos" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   124
            with "var_class" > Output
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   125
        }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   126
    }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   127
    
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   128
    template "ppx:inOutVars" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   129
        call "variables_infos" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   130
            with "var_class" > InOut
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   131
        }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   132
    }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   133
    
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   134
    function "add_variable" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   135
        param "name";
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   136
        param "class";
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   137
        param "type";
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   138
        param "edit" > true
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   139
        param "debug" > true
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   140
        value "ns:AddVariable($name, $class, $type, $edit, $debug)";
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   141
    }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   142
    
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   143
    template "ppx:action", mode="variable_list" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   144
        call "add_variable" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   145
            with "name" > «@name»
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   146
            with "class" > action
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   147
        }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   148
    }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   149
    
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   150
    template "ppx:transition", mode="variable_list" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   151
        call "add_variable" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   152
            with "name" > «@name»
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   153
            with "class" > transition
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   154
        }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   155
    }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   156
    
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   157
    template "ppx:resource", mode="variable_list" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   158
        call "add_variable" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   159
            with "name" > «@name»
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   160
            with "class" > resource
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   161
            with "debug" > false
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   162
        } 
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   163
    }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   164
    
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   165
    template "ppx:pouInstance", mode="variable_list" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   166
        call "add_variable" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   167
            with "name" > «@name»
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   168
            with "class" > program
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   169
            with "type" > «@typeName»
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   170
        }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   171
    }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   172
    
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   173
    template "*[self::ppx:type or self::ppx:baseType]/ppx:derived", mode="var_class" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   174
        param "default_class";
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   175
        variable "type_name", "@name";
1949
c266fbaae0f6 Better writing of some xpath added in previous commits about XSLT optimization.
Edouard Tisserant
parents: 1946
diff changeset
   176
        variable "pou_infos", "$all_types/ppx:pous/ppx:pou[@name=$type_name]";
1348
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   177
        choose {
1943
9dc0e38552b2 GetPouVariables optimized with XSLTModelQuery
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 1936
diff changeset
   178
            when "$pou_infos" {
9dc0e38552b2 GetPouVariables optimized with XSLTModelQuery
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 1936
diff changeset
   179
                apply "$pou_infos", mode="var_class";
1348
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   180
            }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   181
            otherwise {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   182
                value "$default_class"
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   183
            }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   184
        }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   185
    }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   186
    
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   187
    template "ppx:pou", mode="var_class" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   188
        value "@pouType";
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   189
    }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   190
    
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   191
    template "*[self::ppx:type or self::ppx:baseType]/*" mode="var_class" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   192
        param "default_class";
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   193
        value "$default_class";
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   194
    }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   195
  
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   196
    template "*[self::ppx:type or self::ppx:baseType]/ppx:derived", mode="var_type" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   197
        > «@name»
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   198
    }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   199
    
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   200
    template "*[self::ppx:type or self::ppx:baseType]/ppx:array", mode="var_type" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   201
        > ARRAY [
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   202
        foreach "ppx:dimension" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   203
            > «@lower»..«@upper»
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   204
        }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   205
        > ] OF 
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   206
        apply "ppx:baseType", mode="var_type";
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   207
    }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   208
    
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   209
    template "*[self::ppx:type or self::ppx:baseType]/ppx:string", mode="var_type" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   210
        > STRING
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   211
    }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   212
  
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   213
    template "*[self::ppx:type or self::ppx:baseType]/ppx:wstring", mode="var_type" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   214
        > WSTRING
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   215
    }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   216
  
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   217
    template "*[self::ppx:type or self::ppx:baseType]/*", mode="var_type" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   218
        > «local-name()»
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   219
    }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   220
    
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   221
    template "*[self::ppx:type or self::ppx:baseType]/ppx:derived", mode="var_edit" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   222
        variable "type_name", "@name";
1945
90bf6bd94b94 Fixed earlier XSLT optimizations. Some/most results were missing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 1943
diff changeset
   223
        variable "pou_infos", "$project/ppx:types/ppx:pous/ppx:pou[@name=$type_name]";
1348
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   224
        choose {
1943
9dc0e38552b2 GetPouVariables optimized with XSLTModelQuery
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 1936
diff changeset
   225
            when "$pou_infos" > true
1348
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   226
            otherwise > false
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   227
        }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   228
    }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   229
    
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   230
    template "*[self::ppx:type or self::ppx:baseType]/ppx:array", mode="var_edit" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   231
        apply "ppx:baseType", mode="var_edit";
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   232
    }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   233
    
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   234
    template "*[self::ppx:type or self::ppx:baseType]/*", mode="var_edit" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   235
        > false
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   236
    }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   237
    
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   238
    template "*[self::ppx:type or self::ppx:baseType]/ppx:derived", mode="var_debug" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   239
        variable "type_name", "@name";
1946
95fa4e05e30f Avoid endline escaping in multiline xpath epressions in xslt. '&#10;' Is apparently ignored but never know...
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 1945
diff changeset
   240
        variable "datatype_infos", """ \
95fa4e05e30f Avoid endline escaping in multiline xpath epressions in xslt. '&#10;' Is apparently ignored but never know...
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 1945
diff changeset
   241
            $project/ppx:types/ppx:pous/ppx:pou[@name=$type_name] | \
1949
c266fbaae0f6 Better writing of some xpath added in previous commits about XSLT optimization.
Edouard Tisserant
parents: 1946
diff changeset
   242
            $all_types/ppx:dataTypes/ppx:dataType[@name=$type_name] \
1945
90bf6bd94b94 Fixed earlier XSLT optimizations. Some/most results were missing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 1943
diff changeset
   243
        """;
1348
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   244
        choose {
1945
90bf6bd94b94 Fixed earlier XSLT optimizations. Some/most results were missing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 1943
diff changeset
   245
            when "$datatype_infos" {
1943
9dc0e38552b2 GetPouVariables optimized with XSLTModelQuery
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 1936
diff changeset
   246
                apply "$datatype_infos", mode="var_debug";
1348
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   247
            }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   248
            otherwise > false
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   249
        }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   250
    }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   251
    
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   252
    template "ppx:pou", mode="var_debug" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   253
        > true
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   254
    }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   255
    
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   256
    template "*[self::ppx:type or self::ppx:baseType]/ppx:array", mode="var_debug" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   257
        > false
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   258
    }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   259
    
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   260
    template "*[self::ppx:type or self::ppx:baseType]/ppx:struct", mode="var_debug" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   261
        > false
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   262
    }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   263
    
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   264
    template "*[self::ppx:type or self::ppx:baseType]/*", mode="var_debug" {
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   265
        > true
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   266
    }
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   267
    
aee0a7eb833a Fixed pou variables instance information loading stylesheet
Laurent Bessard
parents:
diff changeset
   268
}