edouard@1936: include yslt_noindent.yml2 edouard@1936: istylesheet xmlns:ppx="http://www.plcopen.org/xml/tc6_0201" Laurent@1351: xmlns:xhtml="http://www.w3.org/1999/xhtml" Edouard@1950: xmlns:ns="beremiz" Laurent@1351: extension-element-prefixes="ns" Laurent@1351: exclude-result-prefixes="ns" { Laurent@1351: Laurent@1351: param "instance_path"; Laurent@1351: Edouard@1950: variable "project", "ns:GetProject()"; Laurent@1351: Edouard@1950: variable "stdlib", "ns:GetStdLibs()"; Edouard@1950: Edouard@1950: variable "extensions", "ns:GetExtensions()"; Edouard@1950: Edouard@1950: variable "all_types", "($project | $stdlib | $extensions)/ppx:types"; Laurent@1351: Laurent@1351: function "element_name" { Laurent@1351: param "path"; Laurent@1351: choose { Laurent@1351: when "contains($path,'.')" > «substring-before($path,'.')» Laurent@1351: otherwise > «$path» Laurent@1351: } Laurent@1351: } Laurent@1351: Laurent@1351: function "next_path" { Laurent@1351: param "path"; Laurent@1351: choose { Laurent@1351: when "contains($path,'.')" > «substring-after($path,'.')» Laurent@1351: } Laurent@1351: } Laurent@1351: Laurent@1351: template "ppx:project" { Laurent@1351: variable "config_name" { Laurent@1351: call "element_name" { Laurent@1351: with "path", "$instance_path"; Laurent@1351: } Laurent@1351: } Laurent@1351: apply "ppx:instances/ppx:configurations/ppx:configuration[@name=$config_name]" { Laurent@1351: with "element_path" { Laurent@1351: call "next_path" { Laurent@1351: with "path", "$instance_path"; Laurent@1351: } Laurent@1351: } Laurent@1351: } Laurent@1351: } Laurent@1351: Laurent@1351: template "ppx:configuration" { Laurent@1351: param "element_path"; Laurent@1351: choose { Laurent@1351: when "$element_path!=''" { Laurent@1351: variable "child_name" { Laurent@1351: call "element_name" { Laurent@1351: with "path", "$element_path"; Laurent@1351: } Laurent@1351: } Laurent@1351: apply "ppx:resource[@name=$child_name] | ppx:globalVars/ppx:variable[@name=$child_name]/ppx:type/*[self::ppx:derived or self::ppx:struct or self::ppx:array]" { Laurent@1351: with "element_path" { Laurent@1351: call "next_path" { Laurent@1351: with "path", "$element_path"; Laurent@1351: } Laurent@1351: } Laurent@1351: } Laurent@1351: } Laurent@1351: otherwise { Laurent@1351: value "ns:ConfigTagName(@name)"; Laurent@1351: } Laurent@1351: } Laurent@1351: } Laurent@1351: Laurent@1351: template "ppx:resource" { Laurent@1351: param "element_path"; Laurent@1351: choose { Laurent@1351: when "$element_path!=''" { Laurent@1351: variable "child_name" { Laurent@1351: call "element_name" { Laurent@1351: with "path" > «$element_path» Laurent@1351: } Laurent@1351: } Laurent@1351: apply "ppx:pouInstance[@name=$child_name] | ppx:task/ppx:pouInstance[@name=$child_name] | ppx:globalVars/ppx:variable[@name=$child_name]/ppx:type/*[self::ppx:derived or self::ppx:struct or self::ppx:array]" { Laurent@1351: with "element_path" { Laurent@1351: call "next_path" { Laurent@1351: with "path", "$element_path"; Laurent@1351: } Laurent@1351: } Laurent@1351: } Laurent@1351: } Laurent@1351: otherwise { Laurent@1351: value "ns:ResourceTagName(ancestor::ppx:configuration/@name, @name)"; Laurent@1351: } Laurent@1351: } Laurent@1351: } Laurent@1351: Laurent@1351: template "ppx:pouInstance" { Laurent@1351: param "element_path"; Laurent@1351: variable "type_name" > «@typeName» Edouard@1950: apply """$all_types/ppx:pous/ppx:pou[@name=$type_name] | \ Edouard@1950: $all_types/ppx:dataTypes/ppx:dataType[@name=$type_name]""" { Laurent@1351: with "element_path", "$element_path"; Laurent@1351: } Laurent@1351: } Laurent@1351: Laurent@1351: template "ppx:pou" { Laurent@1351: param "element_path"; Laurent@1351: choose { Laurent@1351: when "$element_path!=''" { Laurent@1351: variable "child_name" { Laurent@1351: call "element_name" { Laurent@1351: with "path", "$element_path"; Laurent@1351: } Laurent@1351: } Laurent@1351: apply "ppx:interface/*/ppx:variable[@name=$child_name]/ppx:type/*[self::ppx:derived or self::ppx:struct or self::ppx:array]" { Laurent@1351: with "element_path" { Laurent@1351: call "next_path" { Laurent@1351: with "path", "$element_path"; Laurent@1351: } Laurent@1351: } Laurent@1351: } Laurent@1351: apply "ppx:actions/ppx:action[@name=$child_name] | ppx:transitions/ppx:transition[@name=$child_name]"; Laurent@1351: } Laurent@1351: otherwise { Laurent@1351: variable "name" > «@name» Laurent@1351: value "ns:PouTagName($name)"; Laurent@1351: } Laurent@1351: } Laurent@1351: } Laurent@1351: Laurent@1351: template "ppx:action" { Laurent@1351: value "ns:ActionTagName(ancestor::ppx:pou/@name, @name)"; Laurent@1351: } Laurent@1351: Laurent@1351: template "ppx:transition" { Laurent@1351: value "ns:TransitionTagName(ancestor::ppx:pou/@name, @name)"; Laurent@1351: } Laurent@1351: Laurent@1351: template "ppx:dataType" { Laurent@1351: param "element_path"; Laurent@1351: apply "ppx:baseType/*[self::ppx:derived or self::ppx:struct or self::ppx:array]" { Laurent@1351: with "element_path", "$element_path"; Laurent@1351: } Laurent@1351: } Laurent@1351: Laurent@1351: template "ppx:derived" { Laurent@1351: param "element_path"; Laurent@1351: variable "type_name" > «@name» Edouard@1950: apply """$all_types/ppx:pous/ppx:pou[@name=$type_name] | \ Edouard@1950: $all_types/ppx:dataTypes/ppx:dataType[@name=$type_name]""" { Laurent@1351: with "element_path", "$element_path"; Laurent@1351: } Laurent@1351: } Laurent@1351: Laurent@1351: template "ppx:array" { Laurent@1351: param "element_path"; Laurent@1351: apply "ppx:baseType/*[self::ppx:derived or self::ppx:struct or self::ppx:array]" { Laurent@1351: with "element_path", "$element_path"; Laurent@1351: } Laurent@1351: } Laurent@1351: Laurent@1351: template "ppx:struct" { Laurent@1351: param "element_path"; Laurent@1351: variable "child_name" { Laurent@1351: call "element_name" { Laurent@1351: with "path", "$element_path"; Laurent@1351: } Laurent@1351: } Laurent@1351: apply "ppx:variable[@name=$child_name]/ppx:type/*[self::ppx:derived or self::ppx:struct or self::ppx:array]" { Laurent@1351: with "element_path" { Laurent@1351: call "next_path" { Laurent@1351: with "path", "$element_path"; Laurent@1351: } Laurent@1351: } Laurent@1351: } Laurent@1351: } Laurent@1351: Laurent@1351: }