# HG changeset patch # User Edouard Tisserant # Date 1697493058 -7200 # Node ID e9807c28a788b62494b4cc01f95004ce6adf8abf # Parent a070a968196150ece1ec865e886abf09c5f916a4 Fix template conflict in XSLT with lxml>=4.9.0 again Earlier attempt was fixing conflict with -1.0 priority attribute, as a side effect of such low priority, SFC Actions were not editable anymore. This time move template around instead of using explicit priority. diff -r a070a9681961 -r e9807c28a788 plcopen/pou_block_instances.xslt --- a/plcopen/pou_block_instances.xslt Mon Oct 16 23:35:47 2023 +0200 +++ b/plcopen/pou_block_instances.xslt Mon Oct 16 23:50:58 2023 +0200 @@ -2,7 +2,7 @@ - + diff -r a070a9681961 -r e9807c28a788 plcopen/pou_block_instances.ysl2 --- a/plcopen/pou_block_instances.ysl2 Mon Oct 16 23:35:47 2023 +0200 +++ b/plcopen/pou_block_instances.ysl2 Mon Oct 16 23:50:58 2023 +0200 @@ -7,7 +7,7 @@ template "text()"; - template "ppx:pou[ppx:body]|ppx:transition[ppx:body]|ppx:action[ppx:body]", priority="-1.0" { + template "ppx:pou[ppx:body]|ppx:transition[ppx:body]|ppx:action[ppx:body]" { apply "ppx:body/*[self::ppx:FBD or self::ppx:LD or self::ppx:SFC]/*"; } diff -r a070a9681961 -r e9807c28a788 plcopen/pou_variables.xslt --- a/plcopen/pou_variables.xslt Mon Oct 16 23:35:47 2023 +0200 +++ b/plcopen/pou_variables.xslt Mon Oct 16 23:50:58 2023 +0200 @@ -202,6 +202,10 @@ + + + + @@ -218,9 +222,8 @@ - - - + + @@ -241,8 +244,8 @@ WSTRING - - + + false @@ -259,8 +262,8 @@ - - false + + true @@ -283,7 +286,4 @@ false - - true - diff -r a070a9681961 -r e9807c28a788 plcopen/pou_variables.ysl2 --- a/plcopen/pou_variables.ysl2 Mon Oct 16 23:35:47 2023 +0200 +++ b/plcopen/pou_variables.ysl2 Mon Oct 16 23:50:58 2023 +0200 @@ -170,6 +170,11 @@ } } + template "*[self::ppx:type or self::ppx:baseType]/*", mode="var_class" { + param "default_class"; + value "$default_class"; + } + template "*[self::ppx:type or self::ppx:baseType]/ppx:derived", mode="var_class" { param "default_class"; variable "type_name", "@name"; @@ -188,11 +193,10 @@ value "@pouType"; } - template "*[self::ppx:type or self::ppx:baseType]/*", mode="var_class", priority="-1.0" { - param "default_class"; - value "$default_class"; - } - + template "*[self::ppx:type or self::ppx:baseType]/*", mode="var_type" { + > «local-name()» + } + template "*[self::ppx:type or self::ppx:baseType]/ppx:derived", mode="var_type" { > «@name» } @@ -214,8 +218,8 @@ > WSTRING } - template "*[self::ppx:type or self::ppx:baseType]/*", mode="var_type", priority="-1.0" { - > «local-name()» + template "*[self::ppx:type or self::ppx:baseType]/*", mode="var_edit" { + > false } template "*[self::ppx:type or self::ppx:baseType]/ppx:derived", mode="var_edit" { @@ -231,8 +235,8 @@ apply "ppx:baseType", mode="var_edit"; } - template "*[self::ppx:type or self::ppx:baseType]/*", mode="var_edit", priority="-1.0" { - > false + template "*[self::ppx:type or self::ppx:baseType]/*", mode="var_debug" { + > true } template "*[self::ppx:type or self::ppx:baseType]/ppx:derived", mode="var_debug" { @@ -261,8 +265,4 @@ > false } - template "*[self::ppx:type or self::ppx:baseType]/*", mode="var_debug", priority="-1.0" { - > true - } - } diff -r a070a9681961 -r e9807c28a788 plcopen/variables_infos.xslt --- a/plcopen/variables_infos.xslt Mon Oct 16 23:35:47 2023 +0200 +++ b/plcopen/variables_infos.xslt Mon Oct 16 23:50:58 2023 +0200 @@ -117,6 +117,12 @@ + + + + + + @@ -155,12 +161,6 @@ - - - - - - diff -r a070a9681961 -r e9807c28a788 plcopen/variables_infos.ysl2 --- a/plcopen/variables_infos.ysl2 Mon Oct 16 23:35:47 2023 +0200 +++ b/plcopen/variables_infos.ysl2 Mon Oct 16 23:50:58 2023 +0200 @@ -117,6 +117,11 @@ template "ppx:dataType", mode="var_type" { apply "ppx:baseType", mode="var_type"; } + + template "*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/*", mode="var_type" { + variable "name" > «local-name()» + value "ns:SetType($name)"; + } template "*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:struct", mode="var_type" { apply "ppx:variable", mode="var_type"; @@ -152,10 +157,6 @@ value "ns:SetType($name)"; } - template "*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/*", mode="var_type", priority="-1.0" { - 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»