1 <xsl:stylesheet xmlns:func="http://exslt.org/functions" xmlns:dyn="http://exslt.org/dynamic" xmlns:str="http://exslt.org/strings" xmlns:math="http://exslt.org/math" xmlns:exsl="http://exslt.org/common" extension-element-prefixes="ns" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:yml="http://fdik.org/yml" xmlns:set="http://exslt.org/sets" version="1.0" xmlns:ppx="http://www.plcopen.org/xml/tc6_0201" xmlns:ns="pou_block_instances_ns" exclude-result-prefixes="ns" xmlns:regexp="http://exslt.org/regular-expressions" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:output method="xml"/><xsl:variable name="space" select="' '"/><xsl:param name="autoindent" select="4"/><xsl:template match="text()"><xsl:param name="_indent" select="0"/></xsl:template><xsl:template match="ppx:pou"><xsl:param name="_indent" select="0"/><xsl:apply-templates select="ppx:body/*[self::ppx:FBD or self::ppx:LD or self::ppx:SFC]/*"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates></xsl:template><xsl:template name="add_instance"><xsl:param name="_indent" select="0"/><xsl:param name="type"/><xsl:value-of select="ns:AddBlockInstance($type, @localId, ppx:position/@x, ppx:position/@y, @width, @height)"/></xsl:template><xsl:template name="execution_order"><xsl:param name="_indent" select="0"/><xsl:choose><xsl:when test="@executionOrderId"><xsl:value-of select="@executionOrderId"/></xsl:when><xsl:otherwise><xsl:text>0</xsl:text></xsl:otherwise></xsl:choose></xsl:template><xsl:template name="ConnectionInfos"><xsl:param name="_indent" select="0"/><xsl:param name="type"/><xsl:param name="negated"/><xsl:param name="edge"/><xsl:param name="formalParameter"/><xsl:value-of select="ns:AddInstanceConnection($type, $formalParameter, $negated, $edge, ppx:relPosition/@x, ppx:relPosition/@y)"/></xsl:template><xsl:template match="ppx:position"><xsl:param name="_indent" select="0"/><xsl:value-of select="ns:AddLinkPoint(@x, @y)"/></xsl:template><xsl:template match="ppx:connection"><xsl:param name="_indent" select="0"/><xsl:value-of select="ns:AddConnectionLink(@refLocalId, @formalParameter)"/><xsl:apply-templates select="ppx:position"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates></xsl:template><xsl:template match="ppx:connectionPointIn"><xsl:param name="_indent" select="0"/><xsl:param name="negated"/><xsl:param name="edge"/><xsl:param name="formalParameter"/><xsl:call-template name="ConnectionInfos"><xsl:with-param name="type"><xsl:text>input</xsl:text></xsl:with-param><xsl:with-param name="negated"><xsl:value-of select="$negated"/></xsl:with-param><xsl:with-param name="edge"><xsl:value-of select="$edge"/></xsl:with-param><xsl:with-param name="formalParameter"><xsl:value-of select="$formalParameter"/></xsl:with-param></xsl:call-template><xsl:apply-templates select="ppx:connection"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates></xsl:template><xsl:template match="ppx:connectionPointOut"><xsl:param name="_indent" select="0"/><xsl:param name="negated"/><xsl:param name="edge"/><xsl:param name="formalParameter"/><xsl:call-template name="ConnectionInfos"><xsl:with-param name="type"><xsl:text>output</xsl:text></xsl:with-param><xsl:with-param name="negated"><xsl:value-of select="$negated"/></xsl:with-param><xsl:with-param name="edge"><xsl:value-of select="$edge"/></xsl:with-param><xsl:with-param name="formalParameter"><xsl:value-of select="$formalParameter"/></xsl:with-param></xsl:call-template></xsl:template><xsl:template match="ppx:connectionPointOutAction"><xsl:param name="_indent" select="0"/><xsl:call-template name="ConnectionInfos"><xsl:with-param name="type"><xsl:text>output</xsl:text></xsl:with-param></xsl:call-template></xsl:template><xsl:template match="ppx:comment"><xsl:param name="_indent" select="0"/><xsl:value-of select="ns:SetSpecificValues(ppx:content/xhtml:p/text())"/><xsl:call-template name="add_instance"><xsl:with-param name="type"><xsl:value-of select="local-name()"/></xsl:with-param></xsl:call-template></xsl:template><xsl:template match="ppx:block"><xsl:param name="_indent" select="0"/><xsl:variable name="execution_order"><xsl:call-template name="execution_order"></xsl:call-template></xsl:variable><xsl:value-of select="ns:SetSpecificValues(@instanceName, $execution_order)"/><xsl:call-template name="add_instance"><xsl:with-param name="type"><xsl:value-of select="@typeName"/></xsl:with-param></xsl:call-template><xsl:for-each select="ppx:inputVariables/ppx:variable"><xsl:apply-templates select="ppx:connectionPointIn"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/><xsl:with-param name="negated" select="@negated"/><xsl:with-param name="edge" select="@edge"/><xsl:with-param name="formalParameter" select="@formalParameter"/></xsl:apply-templates></xsl:for-each><xsl:for-each select="ppx:outputVariables/ppx:variable"><xsl:apply-templates select="ppx:connectionPointOut"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/><xsl:with-param name="negated" select="@negated"/><xsl:with-param name="edge" select="@edge"/><xsl:with-param name="formalParameter" select="@formalParameter"/></xsl:apply-templates></xsl:for-each></xsl:template><xsl:template match="*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:derived"><xsl:param name="_indent" select="0"/><xsl:value-of select="@name"/></xsl:template><xsl:template match="*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:string"><xsl:param name="_indent" select="0"/><xsl:text>STRING</xsl:text></xsl:template><xsl:template match="*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:wstring"><xsl:param name="_indent" select="0"/><xsl:text>WSTRING</xsl:text></xsl:template><xsl:template match="*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/*"><xsl:param name="_indent" select="0"/><xsl:value-of select="local-name()"/></xsl:template><xsl:template name="VariableBlockInfos"><xsl:param name="_indent" select="0"/><xsl:param name="type"/><xsl:variable name="expression"><xsl:value-of select="ppx:expression/text()"/></xsl:variable><xsl:variable name="value_type"><xsl:choose><xsl:when test="ancestor::ppx:transition[@name=$expression]"><xsl:text>BOOL</xsl:text></xsl:when><xsl:when test="ancestor::ppx:pou[@name=$expression]"><xsl:apply-templates select="ancestor::ppx:pou/child::ppx:interface/ppx:returnType"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates></xsl:when><xsl:otherwise><xsl:apply-templates select="ancestor::ppx:pou/child::ppx:interface/*/ppx:variable[@name=$expression]/ppx:type"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates></xsl:otherwise></xsl:choose></xsl:variable><xsl:variable name="execution_order"><xsl:call-template name="execution_order"></xsl:call-template></xsl:variable><xsl:value-of select="ns:SetSpecificValues($expression, $value_type, $execution_order)"/><xsl:call-template name="add_instance"><xsl:with-param name="type"><xsl:value-of select="$type"/></xsl:with-param></xsl:call-template><xsl:apply-templates select="ppx:connectionPointIn"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/><xsl:with-param name="negated" select="@negatedIn"/><xsl:with-param name="edge" select="@edgeIn"/></xsl:apply-templates><xsl:apply-templates select="ppx:connectionPointOut"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/><xsl:with-param name="negated" select="@negatedOut"/><xsl:with-param name="edge" select="@edgeOut"/></xsl:apply-templates></xsl:template><xsl:template match="ppx:inVariable"><xsl:param name="_indent" select="0"/><xsl:call-template name="VariableBlockInfos"><xsl:with-param name="type" select="'input'"/></xsl:call-template></xsl:template><xsl:template match="ppx:outVariable"><xsl:param name="_indent" select="0"/><xsl:call-template name="VariableBlockInfos"><xsl:with-param name="type" select="'output'"/></xsl:call-template></xsl:template><xsl:template match="ppx:inOutVariable"><xsl:param name="_indent" select="0"/><xsl:call-template name="VariableBlockInfos"><xsl:with-param name="type" select="'inout'"/></xsl:call-template></xsl:template><xsl:template match="ppx:connector|ppx:continuation"><xsl:param name="_indent" select="0"/><xsl:value-of select="ns:SetSpecificValues(@name)"/><xsl:call-template name="add_instance"><xsl:with-param name="type"><xsl:value-of select="local-name()"/></xsl:with-param></xsl:call-template><xsl:apply-templates select="ppx:connectionPointIn"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates><xsl:apply-templates select="ppx:connectionPointOut"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates></xsl:template><xsl:template match="ppx:leftPowerRail|ppx:rightPowerRail"><xsl:param name="_indent" select="0"/><xsl:variable name="type" select="local-name()"/><xsl:variable name="connectors"><xsl:choose><xsl:when test="$type='leftPowerRail'"><xsl:value-of select="count(ppx:connectionPointOut)"/></xsl:when><xsl:otherwise><xsl:value-of select="count(ppx:connectionPointIn)"/></xsl:otherwise></xsl:choose></xsl:variable><xsl:value-of select="ns:SetSpecificValues($connectors)"/><xsl:call-template name="add_instance"><xsl:with-param name="type"><xsl:value-of select="$type"/></xsl:with-param></xsl:call-template><xsl:choose><xsl:when test="$type='leftPowerRail'"><xsl:apply-templates select="ppx:connectionPointOut"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates></xsl:when><xsl:otherwise><xsl:apply-templates select="ppx:connectionPointIn"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates></xsl:otherwise></xsl:choose></xsl:template><xsl:template match="ppx:contact|ppx:coil"><xsl:param name="_indent" select="0"/><xsl:variable name="type" select="local-name()"/><xsl:variable name="storage"><xsl:choose><xsl:when test="$type='coil'"><xsl:value-of select="@storage"/></xsl:when></xsl:choose></xsl:variable><xsl:variable name="execution_order"><xsl:call-template name="execution_order"></xsl:call-template></xsl:variable><xsl:value-of select="ns:SetSpecificValues(ppx:variable/text(), @negated, @edge, $storage, $execution_order)"/><xsl:call-template name="add_instance"><xsl:with-param name="type"><xsl:value-of select="$type"/></xsl:with-param></xsl:call-template><xsl:apply-templates select="ppx:connectionPointIn"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates><xsl:apply-templates select="ppx:connectionPointOut"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates></xsl:template><xsl:template match="ppx:step"><xsl:param name="_indent" select="0"/><xsl:value-of select="ns:SetSpecificValues(@name, @initialStep)"/><xsl:apply-templates select="ppx:connectionPointOutAction"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/><xsl:with-param name="negated" select="@negated"/></xsl:apply-templates><xsl:call-template name="add_instance"><xsl:with-param name="type"><xsl:value-of select="local-name()"/></xsl:with-param></xsl:call-template><xsl:apply-templates select="ppx:connectionPointIn"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates><xsl:apply-templates select="ppx:connectionPointOut"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates></xsl:template><xsl:template match="ppx:transition"><xsl:param name="_indent" select="0"/><xsl:variable name="priority"><xsl:choose><xsl:when test="@priority"><xsl:value-of select="@priority"/></xsl:when><xsl:otherwise><xsl:text>0</xsl:text></xsl:otherwise></xsl:choose></xsl:variable><xsl:variable name="condition_type"><xsl:choose><xsl:when test="ppx:condition/ppx:connectionPointIn"><xsl:text>connection</xsl:text></xsl:when><xsl:when test="ppx:condition/ppx:reference"><xsl:text>reference</xsl:text></xsl:when><xsl:when test="ppx:condition/ppx:inline"><xsl:text>inline</xsl:text></xsl:when></xsl:choose></xsl:variable><xsl:variable name="condition"><xsl:choose><xsl:when test="ppx:reference"><xsl:value-of select="ppx:condition/ppx:reference/@name"/></xsl:when><xsl:when test="ppx:inline"><xsl:value-of select="ppx:condition/ppx:inline/ppx:body/ppx:ST/xhtml:p/text()"/></xsl:when></xsl:choose></xsl:variable><xsl:value-of select="ns:SetSpecificValues($priority, $condition_type, $condition)"/><xsl:apply-templates select="ppx:condition/ppx:connectionPointIn"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/><xsl:with-param name="negated" select="ppx:condition/@negated"/></xsl:apply-templates><xsl:call-template name="add_instance"><xsl:with-param name="type"><xsl:value-of select="local-name()"/></xsl:with-param></xsl:call-template><xsl:apply-templates select="ppx:connectionPointIn"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates><xsl:apply-templates select="ppx:connectionPointOut"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates></xsl:template><xsl:template match="ppx:selectionDivergence|ppx:selectionConvergence|ppx:simultaneousDivergence|ppx:simultaneousConvergence"><xsl:param name="_indent" select="0"/><xsl:variable name="type"><xsl:value-of select="local-name()"/></xsl:variable><xsl:variable name="connectors"><xsl:choose><xsl:when test="$type='selectionDivergence' or $type='simultaneousDivergence'"><xsl:value-of select="count(ppx:connectionPointOut)"/></xsl:when><xsl:otherwise><xsl:value-of select="count(ppx:connectionPointIn)"/></xsl:otherwise></xsl:choose></xsl:variable><xsl:value-of select="ns:SetSpecificValues($connectors)"/><xsl:call-template name="add_instance"><xsl:with-param name="type"><xsl:value-of select="$type"/></xsl:with-param></xsl:call-template><xsl:apply-templates select="ppx:connectionPointIn"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates><xsl:apply-templates select="ppx:connectionPointOut"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates></xsl:template><xsl:template match="ppx:jumpStep"><xsl:param name="_indent" select="0"/><xsl:variable name="type"><xsl:text>jump</xsl:text></xsl:variable><xsl:value-of select="ns:SetSpecificValues(@targetName)"/><xsl:call-template name="add_instance"><xsl:with-param name="type"><xsl:value-of select="$type"/></xsl:with-param></xsl:call-template><xsl:apply-templates select="ppx:connectionPointIn"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates></xsl:template><xsl:template match="ppx:action"><xsl:param name="_indent" select="0"/><xsl:variable name="type"><xsl:choose><xsl:when test="ppx:reference"><xsl:text>reference</xsl:text></xsl:when><xsl:when test="ppx:inline"><xsl:text>inline</xsl:text></xsl:when></xsl:choose></xsl:variable><xsl:variable name="value"><xsl:choose><xsl:when test="ppx:reference"><xsl:value-of select="ppx:reference/@name"/></xsl:when><xsl:when test="ppx:inline"><xsl:value-of select="ppx:inline/ppx:ST/xhtml:p/text()"/></xsl:when></xsl:choose></xsl:variable><xsl:variable name="qualifier"><xsl:choose><xsl:when test="@qualifier"><xsl:value-of select="@qualifier"/></xsl:when><xsl:otherwise><xsl:text>N</xsl:text></xsl:otherwise></xsl:choose></xsl:variable><xsl:value-of select="ns:AddAction($qualifier, $type, $value, @duration, @indicator)"/></xsl:template><xsl:template match="ppx:actionBlock"><xsl:param name="_indent" select="0"/><xsl:value-of select="ns:SetSpecificValues()"/><xsl:apply-templates select="ppx:action"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/></xsl:apply-templates><xsl:call-template name="add_instance"><xsl:with-param name="type"><xsl:value-of select="local-name()"/></xsl:with-param></xsl:call-template><xsl:apply-templates select="ppx:connectionPointIn"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/><xsl:with-param name="negated" select="@negated"/></xsl:apply-templates></xsl:template></xsl:stylesheet> |
1 <?xml version="1.0"?> |
|
2 <xsl:stylesheet xmlns:func="http://exslt.org/functions" xmlns:dyn="http://exslt.org/dynamic" xmlns:str="http://exslt.org/strings" xmlns:math="http://exslt.org/math" xmlns:exsl="http://exslt.org/common" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:yml="http://fdik.org/yml" xmlns:set="http://exslt.org/sets" xmlns:ppx="http://www.plcopen.org/xml/tc6_0201" xmlns:ns="pou_block_instances_ns" xmlns:regexp="http://exslt.org/regular-expressions" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" extension-element-prefixes="ns" version="1.0" exclude-result-prefixes="ns"> |
|
3 <xsl:output method="xml"/> |
|
4 <xsl:variable name="space" select="' '"/> |
|
5 <xsl:param name="autoindent" select="4"/> |
|
6 <xsl:template match="text()"> |
|
7 <xsl:param name="_indent" select="0"/> |
|
8 </xsl:template> |
|
9 <xsl:template match="ppx:pou"> |
|
10 <xsl:param name="_indent" select="0"/> |
|
11 <xsl:apply-templates select="ppx:body/*[self::ppx:FBD or self::ppx:LD or self::ppx:SFC]/*"> |
|
12 <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/> |
|
13 </xsl:apply-templates> |
|
14 </xsl:template> |
|
15 <xsl:template name="add_instance"> |
|
16 <xsl:param name="_indent" select="0"/> |
|
17 <xsl:param name="type"/> |
|
18 <xsl:value-of select="ns:AddBlockInstance($type, @localId, ppx:position/@x, ppx:position/@y, @width, @height)"/> |
|
19 </xsl:template> |
|
20 <xsl:template name="execution_order"> |
|
21 <xsl:param name="_indent" select="0"/> |
|
22 <xsl:choose> |
|
23 <xsl:when test="@executionOrderId"> |
|
24 <xsl:value-of select="@executionOrderId"/> |
|
25 </xsl:when> |
|
26 <xsl:otherwise> |
|
27 <xsl:text>0</xsl:text> |
|
28 </xsl:otherwise> |
|
29 </xsl:choose> |
|
30 </xsl:template> |
|
31 <xsl:template name="ConnectionInfos"> |
|
32 <xsl:param name="_indent" select="0"/> |
|
33 <xsl:param name="type"/> |
|
34 <xsl:param name="negated"/> |
|
35 <xsl:param name="edge"/> |
|
36 <xsl:param name="formalParameter"/> |
|
37 <xsl:value-of select="ns:AddInstanceConnection($type, $formalParameter, $negated, $edge, ppx:relPosition/@x, ppx:relPosition/@y)"/> |
|
38 </xsl:template> |
|
39 <xsl:template match="ppx:position"> |
|
40 <xsl:param name="_indent" select="0"/> |
|
41 <xsl:value-of select="ns:AddLinkPoint(@x, @y)"/> |
|
42 </xsl:template> |
|
43 <xsl:template match="ppx:connection"> |
|
44 <xsl:param name="_indent" select="0"/> |
|
45 <xsl:value-of select="ns:AddConnectionLink(@refLocalId, @formalParameter)"/> |
|
46 <xsl:apply-templates select="ppx:position"> |
|
47 <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/> |
|
48 </xsl:apply-templates> |
|
49 </xsl:template> |
|
50 <xsl:template match="ppx:connectionPointIn"> |
|
51 <xsl:param name="_indent" select="0"/> |
|
52 <xsl:param name="negated"/> |
|
53 <xsl:param name="edge"/> |
|
54 <xsl:param name="formalParameter"/> |
|
55 <xsl:call-template name="ConnectionInfos"> |
|
56 <xsl:with-param name="type"> |
|
57 <xsl:text>input</xsl:text> |
|
58 </xsl:with-param> |
|
59 <xsl:with-param name="negated"> |
|
60 <xsl:value-of select="$negated"/> |
|
61 </xsl:with-param> |
|
62 <xsl:with-param name="edge"> |
|
63 <xsl:value-of select="$edge"/> |
|
64 </xsl:with-param> |
|
65 <xsl:with-param name="formalParameter"> |
|
66 <xsl:value-of select="$formalParameter"/> |
|
67 </xsl:with-param> |
|
68 </xsl:call-template> |
|
69 <xsl:apply-templates select="ppx:connection"> |
|
70 <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/> |
|
71 </xsl:apply-templates> |
|
72 </xsl:template> |
|
73 <xsl:template match="ppx:connectionPointOut"> |
|
74 <xsl:param name="_indent" select="0"/> |
|
75 <xsl:param name="negated"/> |
|
76 <xsl:param name="edge"/> |
|
77 <xsl:param name="formalParameter"/> |
|
78 <xsl:call-template name="ConnectionInfos"> |
|
79 <xsl:with-param name="type"> |
|
80 <xsl:text>output</xsl:text> |
|
81 </xsl:with-param> |
|
82 <xsl:with-param name="negated"> |
|
83 <xsl:value-of select="$negated"/> |
|
84 </xsl:with-param> |
|
85 <xsl:with-param name="edge"> |
|
86 <xsl:value-of select="$edge"/> |
|
87 </xsl:with-param> |
|
88 <xsl:with-param name="formalParameter"> |
|
89 <xsl:value-of select="$formalParameter"/> |
|
90 </xsl:with-param> |
|
91 </xsl:call-template> |
|
92 </xsl:template> |
|
93 <xsl:template match="ppx:connectionPointOutAction"> |
|
94 <xsl:param name="_indent" select="0"/> |
|
95 <xsl:call-template name="ConnectionInfos"> |
|
96 <xsl:with-param name="type"> |
|
97 <xsl:text>output</xsl:text> |
|
98 </xsl:with-param> |
|
99 </xsl:call-template> |
|
100 </xsl:template> |
|
101 <xsl:template match="ppx:comment"> |
|
102 <xsl:param name="_indent" select="0"/> |
|
103 <xsl:value-of select="ns:SetSpecificValues(ppx:content/xhtml:p/text())"/> |
|
104 <xsl:call-template name="add_instance"> |
|
105 <xsl:with-param name="type"> |
|
106 <xsl:value-of select="local-name()"/> |
|
107 </xsl:with-param> |
|
108 </xsl:call-template> |
|
109 </xsl:template> |
|
110 <xsl:template match="ppx:block"> |
|
111 <xsl:param name="_indent" select="0"/> |
|
112 <xsl:variable name="execution_order"> |
|
113 <xsl:call-template name="execution_order"/> |
|
114 </xsl:variable> |
|
115 <xsl:value-of select="ns:SetSpecificValues(@instanceName, $execution_order)"/> |
|
116 <xsl:call-template name="add_instance"> |
|
117 <xsl:with-param name="type"> |
|
118 <xsl:value-of select="@typeName"/> |
|
119 </xsl:with-param> |
|
120 </xsl:call-template> |
|
121 <xsl:for-each select="ppx:inputVariables/ppx:variable"> |
|
122 <xsl:apply-templates select="ppx:connectionPointIn"> |
|
123 <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/> |
|
124 <xsl:with-param name="negated" select="@negated"/> |
|
125 <xsl:with-param name="edge" select="@edge"/> |
|
126 <xsl:with-param name="formalParameter" select="@formalParameter"/> |
|
127 </xsl:apply-templates> |
|
128 </xsl:for-each> |
|
129 <xsl:for-each select="ppx:outputVariables/ppx:variable"> |
|
130 <xsl:apply-templates select="ppx:connectionPointOut"> |
|
131 <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/> |
|
132 <xsl:with-param name="negated" select="@negated"/> |
|
133 <xsl:with-param name="edge" select="@edge"/> |
|
134 <xsl:with-param name="formalParameter" select="@formalParameter"/> |
|
135 </xsl:apply-templates> |
|
136 </xsl:for-each> |
|
137 </xsl:template> |
|
138 <xsl:template match="*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:derived"> |
|
139 <xsl:param name="_indent" select="0"/> |
|
140 <xsl:value-of select="@name"/> |
|
141 </xsl:template> |
|
142 <xsl:template match="*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:string"> |
|
143 <xsl:param name="_indent" select="0"/> |
|
144 <xsl:text>STRING</xsl:text> |
|
145 </xsl:template> |
|
146 <xsl:template match="*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:wstring"> |
|
147 <xsl:param name="_indent" select="0"/> |
|
148 <xsl:text>WSTRING</xsl:text> |
|
149 </xsl:template> |
|
150 <xsl:template match="*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/*"> |
|
151 <xsl:param name="_indent" select="0"/> |
|
152 <xsl:value-of select="local-name()"/> |
|
153 </xsl:template> |
|
154 <xsl:template name="VariableBlockInfos"> |
|
155 <xsl:param name="_indent" select="0"/> |
|
156 <xsl:param name="type"/> |
|
157 <xsl:variable name="expression"> |
|
158 <xsl:value-of select="ppx:expression/text()"/> |
|
159 </xsl:variable> |
|
160 <xsl:variable name="value_type"> |
|
161 <xsl:choose> |
|
162 <xsl:when test="ancestor::ppx:transition[@name=$expression]"> |
|
163 <xsl:text>BOOL</xsl:text> |
|
164 </xsl:when> |
|
165 <xsl:when test="ancestor::ppx:pou[@name=$expression]"> |
|
166 <xsl:apply-templates select="ancestor::ppx:pou/child::ppx:interface/ppx:returnType"> |
|
167 <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/> |
|
168 </xsl:apply-templates> |
|
169 </xsl:when> |
|
170 <xsl:otherwise> |
|
171 <xsl:apply-templates select="ancestor::ppx:pou/child::ppx:interface/*/ppx:variable[@name=$expression]/ppx:type"> |
|
172 <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/> |
|
173 </xsl:apply-templates> |
|
174 </xsl:otherwise> |
|
175 </xsl:choose> |
|
176 </xsl:variable> |
|
177 <xsl:variable name="execution_order"> |
|
178 <xsl:call-template name="execution_order"/> |
|
179 </xsl:variable> |
|
180 <xsl:value-of select="ns:SetSpecificValues($expression, $value_type, $execution_order)"/> |
|
181 <xsl:call-template name="add_instance"> |
|
182 <xsl:with-param name="type"> |
|
183 <xsl:value-of select="$type"/> |
|
184 </xsl:with-param> |
|
185 </xsl:call-template> |
|
186 <xsl:apply-templates select="ppx:connectionPointIn"> |
|
187 <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/> |
|
188 <xsl:with-param name="negated" select="@negatedIn"/> |
|
189 <xsl:with-param name="edge" select="@edgeIn"/> |
|
190 </xsl:apply-templates> |
|
191 <xsl:apply-templates select="ppx:connectionPointOut"> |
|
192 <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/> |
|
193 <xsl:with-param name="negated" select="@negatedOut"/> |
|
194 <xsl:with-param name="edge" select="@edgeOut"/> |
|
195 </xsl:apply-templates> |
|
196 </xsl:template> |
|
197 <xsl:template match="ppx:inVariable"> |
|
198 <xsl:param name="_indent" select="0"/> |
|
199 <xsl:call-template name="VariableBlockInfos"> |
|
200 <xsl:with-param name="type" select="'input'"/> |
|
201 </xsl:call-template> |
|
202 </xsl:template> |
|
203 <xsl:template match="ppx:outVariable"> |
|
204 <xsl:param name="_indent" select="0"/> |
|
205 <xsl:call-template name="VariableBlockInfos"> |
|
206 <xsl:with-param name="type" select="'output'"/> |
|
207 </xsl:call-template> |
|
208 </xsl:template> |
|
209 <xsl:template match="ppx:inOutVariable"> |
|
210 <xsl:param name="_indent" select="0"/> |
|
211 <xsl:call-template name="VariableBlockInfos"> |
|
212 <xsl:with-param name="type" select="'inout'"/> |
|
213 </xsl:call-template> |
|
214 </xsl:template> |
|
215 <xsl:template match="ppx:connector|ppx:continuation"> |
|
216 <xsl:param name="_indent" select="0"/> |
|
217 <xsl:value-of select="ns:SetSpecificValues(@name)"/> |
|
218 <xsl:call-template name="add_instance"> |
|
219 <xsl:with-param name="type"> |
|
220 <xsl:value-of select="local-name()"/> |
|
221 </xsl:with-param> |
|
222 </xsl:call-template> |
|
223 <xsl:apply-templates select="ppx:connectionPointIn"> |
|
224 <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/> |
|
225 </xsl:apply-templates> |
|
226 <xsl:apply-templates select="ppx:connectionPointOut"> |
|
227 <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/> |
|
228 </xsl:apply-templates> |
|
229 </xsl:template> |
|
230 <xsl:template match="ppx:leftPowerRail|ppx:rightPowerRail"> |
|
231 <xsl:param name="_indent" select="0"/> |
|
232 <xsl:variable name="type" select="local-name()"/> |
|
233 <xsl:variable name="connectors"> |
|
234 <xsl:choose> |
|
235 <xsl:when test="$type='leftPowerRail'"> |
|
236 <xsl:value-of select="count(ppx:connectionPointOut)"/> |
|
237 </xsl:when> |
|
238 <xsl:otherwise> |
|
239 <xsl:value-of select="count(ppx:connectionPointIn)"/> |
|
240 </xsl:otherwise> |
|
241 </xsl:choose> |
|
242 </xsl:variable> |
|
243 <xsl:value-of select="ns:SetSpecificValues($connectors)"/> |
|
244 <xsl:call-template name="add_instance"> |
|
245 <xsl:with-param name="type"> |
|
246 <xsl:value-of select="$type"/> |
|
247 </xsl:with-param> |
|
248 </xsl:call-template> |
|
249 <xsl:choose> |
|
250 <xsl:when test="$type='leftPowerRail'"> |
|
251 <xsl:apply-templates select="ppx:connectionPointOut"> |
|
252 <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/> |
|
253 </xsl:apply-templates> |
|
254 </xsl:when> |
|
255 <xsl:otherwise> |
|
256 <xsl:apply-templates select="ppx:connectionPointIn"> |
|
257 <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/> |
|
258 </xsl:apply-templates> |
|
259 </xsl:otherwise> |
|
260 </xsl:choose> |
|
261 </xsl:template> |
|
262 <xsl:template match="ppx:contact|ppx:coil"> |
|
263 <xsl:param name="_indent" select="0"/> |
|
264 <xsl:variable name="type" select="local-name()"/> |
|
265 <xsl:variable name="storage"> |
|
266 <xsl:choose> |
|
267 <xsl:when test="$type='coil'"> |
|
268 <xsl:value-of select="@storage"/> |
|
269 </xsl:when> |
|
270 </xsl:choose> |
|
271 </xsl:variable> |
|
272 <xsl:variable name="execution_order"> |
|
273 <xsl:call-template name="execution_order"/> |
|
274 </xsl:variable> |
|
275 <xsl:value-of select="ns:SetSpecificValues(ppx:variable/text(), @negated, @edge, $storage, $execution_order)"/> |
|
276 <xsl:call-template name="add_instance"> |
|
277 <xsl:with-param name="type"> |
|
278 <xsl:value-of select="$type"/> |
|
279 </xsl:with-param> |
|
280 </xsl:call-template> |
|
281 <xsl:apply-templates select="ppx:connectionPointIn"> |
|
282 <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/> |
|
283 </xsl:apply-templates> |
|
284 <xsl:apply-templates select="ppx:connectionPointOut"> |
|
285 <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/> |
|
286 </xsl:apply-templates> |
|
287 </xsl:template> |
|
288 <xsl:template match="ppx:step"> |
|
289 <xsl:param name="_indent" select="0"/> |
|
290 <xsl:value-of select="ns:SetSpecificValues(@name, @initialStep)"/> |
|
291 <xsl:apply-templates select="ppx:connectionPointOutAction"> |
|
292 <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/> |
|
293 <xsl:with-param name="negated" select="@negated"/> |
|
294 </xsl:apply-templates> |
|
295 <xsl:call-template name="add_instance"> |
|
296 <xsl:with-param name="type"> |
|
297 <xsl:value-of select="local-name()"/> |
|
298 </xsl:with-param> |
|
299 </xsl:call-template> |
|
300 <xsl:apply-templates select="ppx:connectionPointIn"> |
|
301 <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/> |
|
302 </xsl:apply-templates> |
|
303 <xsl:apply-templates select="ppx:connectionPointOut"> |
|
304 <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/> |
|
305 </xsl:apply-templates> |
|
306 </xsl:template> |
|
307 <xsl:template match="ppx:transition"> |
|
308 <xsl:param name="_indent" select="0"/> |
|
309 <xsl:variable name="priority"> |
|
310 <xsl:choose> |
|
311 <xsl:when test="@priority"> |
|
312 <xsl:value-of select="@priority"/> |
|
313 </xsl:when> |
|
314 <xsl:otherwise> |
|
315 <xsl:text>0</xsl:text> |
|
316 </xsl:otherwise> |
|
317 </xsl:choose> |
|
318 </xsl:variable> |
|
319 <xsl:variable name="condition_type"> |
|
320 <xsl:choose> |
|
321 <xsl:when test="ppx:condition/ppx:connectionPointIn"> |
|
322 <xsl:text>connection</xsl:text> |
|
323 </xsl:when> |
|
324 <xsl:when test="ppx:condition/ppx:reference"> |
|
325 <xsl:text>reference</xsl:text> |
|
326 </xsl:when> |
|
327 <xsl:when test="ppx:condition/ppx:inline"> |
|
328 <xsl:text>inline</xsl:text> |
|
329 </xsl:when> |
|
330 </xsl:choose> |
|
331 </xsl:variable> |
|
332 <xsl:variable name="condition"> |
|
333 <xsl:choose> |
|
334 <xsl:when test="ppx:reference"> |
|
335 <xsl:value-of select="ppx:condition/ppx:reference/@name"/> |
|
336 </xsl:when> |
|
337 <xsl:when test="ppx:inline"> |
|
338 <xsl:value-of select="ppx:condition/ppx:inline/ppx:body/ppx:ST/xhtml:p/text()"/> |
|
339 </xsl:when> |
|
340 </xsl:choose> |
|
341 </xsl:variable> |
|
342 <xsl:value-of select="ns:SetSpecificValues($priority, $condition_type, $condition)"/> |
|
343 <xsl:apply-templates select="ppx:condition/ppx:connectionPointIn"> |
|
344 <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/> |
|
345 <xsl:with-param name="negated" select="ppx:condition/@negated"/> |
|
346 </xsl:apply-templates> |
|
347 <xsl:call-template name="add_instance"> |
|
348 <xsl:with-param name="type"> |
|
349 <xsl:value-of select="local-name()"/> |
|
350 </xsl:with-param> |
|
351 </xsl:call-template> |
|
352 <xsl:apply-templates select="ppx:connectionPointIn"> |
|
353 <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/> |
|
354 </xsl:apply-templates> |
|
355 <xsl:apply-templates select="ppx:connectionPointOut"> |
|
356 <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/> |
|
357 </xsl:apply-templates> |
|
358 </xsl:template> |
|
359 <xsl:template match="ppx:selectionDivergence|ppx:selectionConvergence|ppx:simultaneousDivergence|ppx:simultaneousConvergence"> |
|
360 <xsl:param name="_indent" select="0"/> |
|
361 <xsl:variable name="type"> |
|
362 <xsl:value-of select="local-name()"/> |
|
363 </xsl:variable> |
|
364 <xsl:variable name="connectors"> |
|
365 <xsl:choose> |
|
366 <xsl:when test="$type='selectionDivergence' or $type='simultaneousDivergence'"> |
|
367 <xsl:value-of select="count(ppx:connectionPointOut)"/> |
|
368 </xsl:when> |
|
369 <xsl:otherwise> |
|
370 <xsl:value-of select="count(ppx:connectionPointIn)"/> |
|
371 </xsl:otherwise> |
|
372 </xsl:choose> |
|
373 </xsl:variable> |
|
374 <xsl:value-of select="ns:SetSpecificValues($connectors)"/> |
|
375 <xsl:call-template name="add_instance"> |
|
376 <xsl:with-param name="type"> |
|
377 <xsl:value-of select="$type"/> |
|
378 </xsl:with-param> |
|
379 </xsl:call-template> |
|
380 <xsl:apply-templates select="ppx:connectionPointIn"> |
|
381 <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/> |
|
382 </xsl:apply-templates> |
|
383 <xsl:apply-templates select="ppx:connectionPointOut"> |
|
384 <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/> |
|
385 </xsl:apply-templates> |
|
386 </xsl:template> |
|
387 <xsl:template match="ppx:jumpStep"> |
|
388 <xsl:param name="_indent" select="0"/> |
|
389 <xsl:variable name="type"> |
|
390 <xsl:text>jump</xsl:text> |
|
391 </xsl:variable> |
|
392 <xsl:value-of select="ns:SetSpecificValues(@targetName)"/> |
|
393 <xsl:call-template name="add_instance"> |
|
394 <xsl:with-param name="type"> |
|
395 <xsl:value-of select="$type"/> |
|
396 </xsl:with-param> |
|
397 </xsl:call-template> |
|
398 <xsl:apply-templates select="ppx:connectionPointIn"> |
|
399 <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/> |
|
400 </xsl:apply-templates> |
|
401 </xsl:template> |
|
402 <xsl:template match="ppx:action"> |
|
403 <xsl:param name="_indent" select="0"/> |
|
404 <xsl:variable name="type"> |
|
405 <xsl:choose> |
|
406 <xsl:when test="ppx:reference"> |
|
407 <xsl:text>reference</xsl:text> |
|
408 </xsl:when> |
|
409 <xsl:when test="ppx:inline"> |
|
410 <xsl:text>inline</xsl:text> |
|
411 </xsl:when> |
|
412 </xsl:choose> |
|
413 </xsl:variable> |
|
414 <xsl:variable name="value"> |
|
415 <xsl:choose> |
|
416 <xsl:when test="ppx:reference"> |
|
417 <xsl:value-of select="ppx:reference/@name"/> |
|
418 </xsl:when> |
|
419 <xsl:when test="ppx:inline"> |
|
420 <xsl:value-of select="ppx:inline/ppx:ST/xhtml:p/text()"/> |
|
421 </xsl:when> |
|
422 </xsl:choose> |
|
423 </xsl:variable> |
|
424 <xsl:variable name="qualifier"> |
|
425 <xsl:choose> |
|
426 <xsl:when test="@qualifier"> |
|
427 <xsl:value-of select="@qualifier"/> |
|
428 </xsl:when> |
|
429 <xsl:otherwise> |
|
430 <xsl:text>N</xsl:text> |
|
431 </xsl:otherwise> |
|
432 </xsl:choose> |
|
433 </xsl:variable> |
|
434 <xsl:value-of select="ns:AddAction($qualifier, $type, $value, @duration, @indicator)"/> |
|
435 </xsl:template> |
|
436 <xsl:template match="ppx:actionBlock"> |
|
437 <xsl:param name="_indent" select="0"/> |
|
438 <xsl:value-of select="ns:SetSpecificValues()"/> |
|
439 <xsl:apply-templates select="ppx:action"> |
|
440 <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/> |
|
441 </xsl:apply-templates> |
|
442 <xsl:call-template name="add_instance"> |
|
443 <xsl:with-param name="type"> |
|
444 <xsl:value-of select="local-name()"/> |
|
445 </xsl:with-param> |
|
446 </xsl:call-template> |
|
447 <xsl:apply-templates select="ppx:connectionPointIn"> |
|
448 <xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/> |
|
449 <xsl:with-param name="negated" select="@negated"/> |
|
450 </xsl:apply-templates> |
|
451 </xsl:template> |
|
452 </xsl:stylesheet> |