estylesheet xmlns:ppx="http://www.plcopen.org/xml/tc6_0201"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
extension-element-prefixes="ns"
exclude-result-prefixes="ns" {
copy "document('project')/project/*";
copy "document('stdlib')/stdlib/*";
copy "document('extensions')/extensions/*";
template "ppx:returnType" {
function "variables_infos" {
when "@constant='true' or @constant='1'" > Constant
when "@retain='true' or @retain='1'" > Retain
when "@nonretain='true' or @nonretain='1'" > Non-Retain
variable "initial_value" {
apply "ppx:initialValue";
when "$var_class='Global' or $var_class='External'" > true
apply "ppx:type", mode="var_edit";
value "ns:AddVariable(@name, $var_class, $var_option, @address, $initial_value, $edit, ppx:documentation/xhtml:p/text())";
template "ppx:localVars" {
template "ppx:globalVars" {
with "var_class" > Global
template "ppx:externalVars" {
with "var_class" > External
template "ppx:tempVars" {
template "ppx:inputVars" {
template "ppx:outputVars" {
with "var_class" > Output
template "ppx:inOutVars" {
apply "ppx:interface/*[self::ppx:inputVars or self::ppx:inOutVars or self::ppx:outputVars]/ppx:variable";
template "ppx:variable" {
variable "name" > «@name»
value "ns:AddTree($name)";
value "ns:AddVarToTree($name)";
template "ppx:dataType" {
template "*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:struct" {
template "*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:derived" {
variable "type_name" > «@name»
apply """exsl:node-set($project)/ppx:project/ppx:types/ppx:pous/ppx:pou[@name=$type_name] |
exsl:node-set($project)/ppx:project/ppx:types/ppx:dataTypes/ppx:dataType[@name=$type_name] |
exsl:node-set($stdlib)/ppx:project/ppx:types/ppx:pous/ppx:pou[@name=$type_name] |
exsl:node-set($stdlib)/ppx:project/ppx:types/ppx:dataTypes/ppx:dataType[@name=$type_name] |
exsl:node-set($extensions)/ppx:project/ppx:types/ppx:pous/ppx:pou[@name=$type_name] |
exsl:node-set($extensions)/ppx:project/ppx:types/ppx:dataTypes/ppx:dataType[@name=$type_name]""";
value "ns:SetType($type_name)";
template "*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:array" {
foreach "ppx:dimension" {
value "ns:AddDimension(@lower, @upper)";
template "*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:string" {
value "ns:SetType($name)";
template "*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:wstring" {
variable "name" > WSTRING
value "ns:SetType($name)";
template "*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/*" {
variable "name" > «local-name()»
value "ns:SetType($name)";
template "*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:derived", mode="var_edit" {
variable "type_name", "@name";
copy """exsl:node-set($project)/ppx:project/ppx:types/ppx:pous/ppx:pou[@name=$type_name] |
exsl:node-set($stdlib)/ppx:project/ppx:types/ppx:pous/ppx:pou[@name=$type_name] |
exsl:node-set($extensions)/ppx:project/ppx:types/ppx:pous/ppx:pou[@name=$type_name]""";
when "$pou_infos != ''" > false
template "*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/*", mode="var_edit" {
when "@repetitionValue" {
template "ppx:simpleValue" {
function "complex_type_value" {
when "position()!=last()" > ,
template "ppx:arrayValue" {
call "complex_type_value" {
template "ppx:structValue" {
call "complex_type_value" {