Improved syntax of pou block information loading stylesheet
authorLaurent Bessard
Fri, 04 Oct 2013 12:16:31 +0200
changeset 1345 53e51e786654
parent 1344 2eaa84c37f10
child 1346 92efd8fe3120
Improved syntax of pou block information loading stylesheet
plcopen/pou_block_instances.xslt
plcopen/pou_block_instances.ysl2
--- a/plcopen/pou_block_instances.xslt	Fri Oct 04 09:40:16 2013 +0200
+++ b/plcopen/pou_block_instances.xslt	Fri Oct 04 12:16:31 2013 +0200
@@ -1,1 +1,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:variable name="instance"><xsl:value-of select="ns:AddBlockInstance($type, @localId, ppx:position/@x, ppx:position/@y, @width, @height)"/></xsl:variable></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:variable name="instance_connection"><xsl:value-of select="ns:AddInstanceConnection($type, $formalParameter, $negated, $edge, ppx:relPosition/@x, ppx:relPosition/@y)"/></xsl:variable></xsl:template><xsl:template match="ppx:position"><xsl:param name="_indent" select="0"/><xsl:variable name="link_point"><xsl:value-of select="ns:AddLinkPoint(@x, @y)"/></xsl:variable></xsl:template><xsl:template match="ppx:connection"><xsl:param name="_indent" select="0"/><xsl:variable name="connection_link"><xsl:value-of select="ns:AddConnectionLink(@refLocalId, @formalParameter)"/></xsl:variable><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:variable name="type"><xsl:value-of select="local-name()"/></xsl:variable><xsl:variable name="instance_specific_values"><xsl:value-of select="ns:SetSpecificValues(ppx:content/xhtml:p/text())"/></xsl:variable><xsl:call-template name="add_instance"><xsl:with-param name="type"><xsl:value-of select="$type"/></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:variable name="instance_specific_values"><xsl:value-of select="ns:SetSpecificValues(@instanceName, $execution_order)"/></xsl:variable><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"><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: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"><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: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:variable name="instance_specific_values"><xsl:value-of select="ns:SetSpecificValues($expression, $value_type, $execution_order)"/></xsl:variable><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"><xsl:value-of select="@negatedIn"/></xsl:with-param><xsl:with-param name="edge"><xsl:value-of select="@edgeIn"/></xsl:with-param></xsl:apply-templates><xsl:apply-templates select="ppx:connectionPointOut"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/><xsl:with-param name="negated"><xsl:value-of select="@negatedOut"/></xsl:with-param><xsl:with-param name="edge"><xsl:value-of select="@edgeOut"/></xsl:with-param></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:variable name="type"><xsl:value-of select="local-name()"/></xsl:variable><xsl:variable name="instance_specific_values"><xsl:value-of select="ns:SetSpecificValues(@name)"/></xsl:variable><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:leftPowerRail|ppx:rightPowerRail"><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='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:variable name="instance_specific_values"><xsl:value-of select="ns:SetSpecificValues($connectors)"/></xsl:variable><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"><xsl:value-of select="local-name()"/></xsl:variable><xsl:variable name="storage"><xsl:choose><xsl:when test="$type='coil'"><xsl:value-of select="@storage"/></xsl:when><xsl:otherwise></xsl:otherwise></xsl:choose></xsl:variable><xsl:variable name="execution_order"><xsl:call-template name="execution_order"></xsl:call-template></xsl:variable><xsl:variable name="instance_specific_values"><xsl:value-of select="ns:SetSpecificValues(ppx:variable/text(), @negated, @edge, $storage, $execution_order)"/></xsl:variable><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:variable name="type"><xsl:value-of select="local-name()"/></xsl:variable><xsl:variable name="instance_specific_values"><xsl:value-of select="ns:SetSpecificValues(@name, @initialStep)"/></xsl:variable><xsl:apply-templates select="ppx:connectionPointOutAction"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/><xsl:with-param name="negated"><xsl:value-of select="@negated"/></xsl:with-param></xsl:apply-templates><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:transition"><xsl:param name="_indent" select="0"/><xsl:variable name="type"><xsl:value-of select="local-name()"/></xsl:variable><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:otherwise></xsl:otherwise></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:otherwise></xsl:otherwise></xsl:choose></xsl:variable><xsl:variable name="instance_specific_values"><xsl:value-of select="ns:SetSpecificValues($priority, $condition_type, $condition)"/></xsl:variable><xsl:apply-templates select="ppx:condition/ppx:connectionPointIn"><xsl:with-param name="_indent" select="$_indent + (1) * $autoindent"/><xsl:with-param name="negated"><xsl:value-of select="ppx:condition/@negated"/></xsl:with-param></xsl:apply-templates><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: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="ppx:selectionDivergence|ppx: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:variable name="instance_specific_values"><xsl:value-of select="ns:SetSpecificValues($connectors)"/></xsl:variable><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:variable name="instance_specific_values"><xsl:value-of select="ns:SetSpecificValues(@targetName)"/></xsl:variable><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:otherwise></xsl:otherwise></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:otherwise></xsl:otherwise></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:variable name="actionBlock_action"><xsl:value-of select="ns:AddAction($qualifier, $type, $value, @duration, @indicator)"/></xsl:variable></xsl:template><xsl:template match="ppx:actionBlock"><xsl:param name="_indent" select="0"/><xsl:variable name="type"><xsl:value-of select="local-name()"/></xsl:variable><xsl:variable name="instance_specific_values"><xsl:value-of select="ns:SetSpecificValues()"/></xsl:variable><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="$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"><xsl:value-of select="@negated"/></xsl:with-param></xsl:apply-templates></xsl:template></xsl:stylesheet>
\ No newline at end of file
+<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>
\ No newline at end of file
--- a/plcopen/pou_block_instances.ysl2	Fri Oct 04 09:40:16 2013 +0200
+++ b/plcopen/pou_block_instances.ysl2	Fri Oct 04 12:16:31 2013 +0200
@@ -4,7 +4,7 @@
             xmlns:ns="pou_block_instances_ns" 
             extension-element-prefixes="ns" 
             exclude-result-prefixes="ns" {
-
+    
     template "text()";
     
     template "ppx:pou" {
@@ -13,9 +13,7 @@
     
     function "add_instance" {
         param "type";
-        variable "instance" {
-            > «ns:AddBlockInstance($type, @localId, ppx:position/@x, ppx:position/@y, @width, @height)»
-        }
+        value "ns:AddBlockInstance($type, @localId, ppx:position/@x, ppx:position/@y, @width, @height)";
     }
     
     function "execution_order" {
@@ -30,21 +28,15 @@
         param "negated";
         param "edge";
         param "formalParameter";
-        variable "instance_connection" {
-            > «ns:AddInstanceConnection($type, $formalParameter, $negated, $edge, ppx:relPosition/@x, ppx:relPosition/@y)»
-        }
+        value "ns:AddInstanceConnection($type, $formalParameter, $negated, $edge, ppx:relPosition/@x, ppx:relPosition/@y)";
     }
     
     template "ppx:position" {
-        variable "link_point" {
-            > «ns:AddLinkPoint(@x, @y)»
-        }
+        value "ns:AddLinkPoint(@x, @y)";
     }
     
     template "ppx:connection" {
-        variable "connection_link" {
-            > «ns:AddConnectionLink(@refLocalId, @formalParameter)»
-        }
+        value "ns:AddConnectionLink(@refLocalId, @formalParameter)";
         apply "ppx:position";
     }
     
@@ -80,12 +72,9 @@
     }
     
     template "ppx:comment" {
-        variable "type" > «local-name()»
-        variable "instance_specific_values" {
-            > «ns:SetSpecificValues(ppx:content/xhtml:p/text())»
-        }
-        call "add_instance" {
-            with "type" > «$type»
+        value "ns:SetSpecificValues(ppx:content/xhtml:p/text())";
+        call "add_instance" {
+            with "type" > «local-name()»
         }
     }
     
@@ -93,24 +82,22 @@
         variable "execution_order" {
             call "execution_order";
         }
-        variable "instance_specific_values" {
-            > «ns:SetSpecificValues(@instanceName, $execution_order)»
-        }
+        value "ns:SetSpecificValues(@instanceName, $execution_order)";
         call "add_instance" {
             with "type" > «@typeName»
         }
         foreach "ppx:inputVariables/ppx:variable" {
             apply "ppx:connectionPointIn" {
-                with "negated" > «@negated»
-                with "edge" > «@edge»
-                with "formalParameter" > «@formalParameter»
+                with "negated", "@negated";
+                with "edge", "@edge";
+                with "formalParameter", "@formalParameter";
             }
         }
         foreach "ppx:outputVariables/ppx:variable" {
             apply "ppx:connectionPointOut" {
-                with "negated" > «@negated»
-                with "edge" > «@edge»
-                with "formalParameter" > «@formalParameter»
+                with "negated", "@negated";
+                with "edge", "@edge";
+                with "formalParameter", "@formalParameter";
             }
         }
     }
@@ -148,19 +135,17 @@
         variable "execution_order" {
             call "execution_order";
         }
-        variable "instance_specific_values" {
-            > «ns:SetSpecificValues($expression, $value_type, $execution_order)»
-        }
+        value "ns:SetSpecificValues($expression, $value_type, $execution_order)";
         call "add_instance" {
             with "type" > «$type»
         }
         apply "ppx:connectionPointIn" {
-            with "negated" > «@negatedIn»
-            with "edge" > «@edgeIn»
+            with "negated", "@negatedIn";
+            with "edge", "@edgeIn";
         }
         apply "ppx:connectionPointOut" {
-            with "negated" > «@negatedOut»
-            with "edge" > «@edgeOut»
+            with "negated", "@negatedOut";
+            with "edge", "@edgeOut";
         }
     }
     
@@ -177,28 +162,23 @@
     }
     
     template "ppx:connector|ppx:continuation" {
-        variable "type" > «local-name()»
-        variable "instance_specific_values" {
-            > «ns:SetSpecificValues(@name)»
-        }
-        call "add_instance" {
-            with "type" > «$type»
+        value "ns:SetSpecificValues(@name)";
+        call "add_instance" {
+            with "type" > «local-name()»
         }
         apply "ppx:connectionPointIn";
         apply "ppx:connectionPointOut";
     }
     
     template "ppx:leftPowerRail|ppx:rightPowerRail" {
-        variable "type" > «local-name()»
+        variable "type", "local-name()";
         variable "connectors" {
             choose {
                 when "$type='leftPowerRail'" > «count(ppx:connectionPointOut)»
                 otherwise > «count(ppx:connectionPointIn)»
             }
         }
-        variable "instance_specific_values" {
-            > «ns:SetSpecificValues($connectors)»
-        }
+        value "ns:SetSpecificValues($connectors)";
         call "add_instance" {
             with "type" > «$type»
         }
@@ -213,19 +193,16 @@
     }
     
     template "ppx:contact|ppx:coil" {
-        variable "type" > «local-name()»
+        variable "type", "local-name()";
         variable "storage" {
             choose {
                 when "$type='coil'" > «@storage»
-                otherwise > 
             }
         }
         variable "execution_order" {
             call "execution_order";
         }
-        variable "instance_specific_values" {
-            > «ns:SetSpecificValues(ppx:variable/text(), @negated, @edge, $storage, $execution_order)»
-        }
+        value "ns:SetSpecificValues(ppx:variable/text(), @negated, @edge, $storage, $execution_order)";
         call "add_instance" {
             with "type" > «$type»
         }
@@ -234,22 +211,18 @@
     }
     
     template "ppx:step" {
-        variable "type" > «local-name()»
-        variable "instance_specific_values" {
-            > «ns:SetSpecificValues(@name, @initialStep)»
-        }
+        value "ns:SetSpecificValues(@name, @initialStep)";
         apply "ppx:connectionPointOutAction" {
-            with "negated" > «@negated»
-        }
-        call "add_instance" {
-            with "type" > «$type»
+            with "negated", "@negated";
+        }
+        call "add_instance" {
+            with "type" > «local-name()»
         }
         apply "ppx:connectionPointIn";
         apply "ppx:connectionPointOut";
     }
     
     template "ppx:transition" {
-        variable "type" > «local-name()»
         variable "priority" {
             choose {
                 when "@priority" > «@priority»
@@ -261,24 +234,20 @@
                 when "ppx:condition/ppx:connectionPointIn" > connection
                 when "ppx:condition/ppx:reference" > reference
                 when "ppx:condition/ppx:inline" > inline
-                otherwise > 
             }
         }
         variable "condition" {
             choose {
                 when "ppx:reference" > «ppx:condition/ppx:reference/@name»
                 when "ppx:inline" > «ppx:condition/ppx:inline/ppx:body/ppx:ST/xhtml:p/text()»
-                otherwise > 
-            }
-        }
-        variable "instance_specific_values" {
-            > «ns:SetSpecificValues($priority, $condition_type, $condition)»
-        }
+            }
+        }
+        value "ns:SetSpecificValues($priority, $condition_type, $condition)";
         apply "ppx:condition/ppx:connectionPointIn" {
-            with "negated" > «ppx:condition/@negated»
-        }
-        call "add_instance" {
-            with "type" > «$type»
+            with "negated", "ppx:condition/@negated";
+        }
+        call "add_instance" {
+            with "type" > «local-name()»
         }
         apply "ppx:connectionPointIn";
         apply "ppx:connectionPointOut";
@@ -288,15 +257,13 @@
         variable "type" > «local-name()»
         variable "connectors" {
             choose {
-                when "ppx:selectionDivergence|ppx:simultaneousDivergence" {
+                when "$type='selectionDivergence' or $type='simultaneousDivergence'" {
                     > «count(ppx:connectionPointOut)»
                 }
                 otherwise > «count(ppx:connectionPointIn)»
             }
         }
-        variable "instance_specific_values" {
-            > «ns:SetSpecificValues($connectors)»
-        }
+        value "ns:SetSpecificValues($connectors)";
         call "add_instance" {
             with "type" > «$type»
         }
@@ -306,9 +273,7 @@
     
     template "ppx:jumpStep" {
         variable "type" > jump
-        variable "instance_specific_values" {
-            > «ns:SetSpecificValues(@targetName)»
-        }
+        value "ns:SetSpecificValues(@targetName)";
         call "add_instance" {
             with "type" > «$type»
         }
@@ -320,14 +285,12 @@
             choose {
                 when "ppx:reference" > reference
                 when "ppx:inline" > inline
-                otherwise > 
             }
         }
         variable "value" {
             choose {
                 when "ppx:reference" > «ppx:reference/@name»
                 when "ppx:inline" > «ppx:inline/ppx:ST/xhtml:p/text()»
-                otherwise > 
             }
         }
         variable "qualifier" {
@@ -336,22 +299,17 @@
                 otherwise > N
             }
         }
-        variable "actionBlock_action" {
-            > «ns:AddAction($qualifier, $type, $value, @duration, @indicator)»
-        }
+        value "ns:AddAction($qualifier, $type, $value, @duration, @indicator)";
     }
     
     template "ppx:actionBlock" {
-        variable "type" > «local-name()»
-        variable "instance_specific_values" {
-            > «ns:SetSpecificValues()»
-        }
+        value "ns:SetSpecificValues()";
         apply "ppx:action";
         call "add_instance" {
-            with "type" > «$type»
+            with "type" > «local-name()»
         }
         apply "ppx:connectionPointIn" {
-            with "negated" > «@negated»
+            with "negated", "@negated";
         }
     }
 }
\ No newline at end of file