# HG changeset patch
# User Edouard Tisserant
# Date 1519049736 -3600
# Node ID c266fbaae0f6ad026a22004454ad4daad95e895d
# Parent b9a3f771aaab9096d989b6d531040452cb2178f5
Better writing of some xpath added in previous commits about XSLT optimization.
diff -r b9a3f771aaab -r c266fbaae0f6 plcopen/instances_path.xslt
--- a/plcopen/instances_path.xslt Mon Feb 19 15:14:30 2018 +0100
+++ b/plcopen/instances_path.xslt Mon Feb 19 15:15:36 2018 +0100
@@ -6,7 +6,7 @@
-
+
@@ -45,7 +45,7 @@
-
+
@@ -92,7 +92,7 @@
-
+
diff -r b9a3f771aaab -r c266fbaae0f6 plcopen/instances_path.ysl2
--- a/plcopen/instances_path.ysl2 Mon Feb 19 15:14:30 2018 +0100
+++ b/plcopen/instances_path.ysl2 Mon Feb 19 15:15:36 2018 +0100
@@ -15,8 +15,7 @@
variable "extensions", "ns:GetExtensions()";
- variable "all", "$project | $stdlib | $extensions";
-
+ variable "all_types", "($project | $stdlib | $extensions)/ppx:types";
template "ppx:project" {
apply "ppx:instances/ppx:configurations/ppx:configuration";
@@ -45,8 +44,8 @@
}
otherwise {
variable "type_name" > «@typeName»
- apply """$all/ppx:types/ppx:pous/ppx:pou[@name=$type_name] | \
- $all/ppx:types/ppx:dataTypes/ppx:dataType[@name=$type_name]""" {
+ apply """$all_types/ppx:pous/ppx:pou[@name=$type_name] | \
+ $all_types/ppx:dataTypes/ppx:dataType[@name=$type_name]""" {
with "instance_path" > «$pou_instance_path»
}
}
@@ -83,8 +82,8 @@
}
otherwise {
variable "type_name" > «@name»
- apply """$all/ppx:types/ppx:pous/ppx:pou[@name=$type_name] | \
- $all/ppx:types/ppx:dataTypes/ppx:dataType[@name=$type_name]""" {
+ apply """$all_types/ppx:pous/ppx:pou[@name=$type_name] | \
+ $all_types/ppx:dataTypes/ppx:dataType[@name=$type_name]""" {
with "instance_path" > «$variable_path»
}
}
diff -r b9a3f771aaab -r c266fbaae0f6 plcopen/pou_variables.xslt
--- a/plcopen/pou_variables.xslt Mon Feb 19 15:14:30 2018 +0100
+++ b/plcopen/pou_variables.xslt Mon Feb 19 15:15:36 2018 +0100
@@ -9,7 +9,7 @@
-
+
@@ -205,7 +205,7 @@
-
+
@@ -264,7 +264,7 @@
-
+
diff -r b9a3f771aaab -r c266fbaae0f6 plcopen/pou_variables.ysl2
--- a/plcopen/pou_variables.ysl2 Mon Feb 19 15:14:30 2018 +0100
+++ b/plcopen/pou_variables.ysl2 Mon Feb 19 15:15:36 2018 +0100
@@ -17,7 +17,7 @@
variable "extensions", "ns:GetExtensions()";
- variable "all", "$project | $stdlib | $extensions";
+ variable "all_types", "($project | $stdlib | $extensions)/ppx:types";
function "add_root" {
param "class";
@@ -173,7 +173,7 @@
template "*[self::ppx:type or self::ppx:baseType]/ppx:derived", mode="var_class" {
param "default_class";
variable "type_name", "@name";
- variable "pou_infos", "$all/ppx:types/ppx:pous/ppx:pou[@name=$type_name]";
+ variable "pou_infos", "$all_types/ppx:pous/ppx:pou[@name=$type_name]";
choose {
when "$pou_infos" {
apply "$pou_infos", mode="var_class";
@@ -239,7 +239,7 @@
variable "type_name", "@name";
variable "datatype_infos", """ \
$project/ppx:types/ppx:pous/ppx:pou[@name=$type_name] | \
- $all/ppx:types/ppx:dataTypes/ppx:dataType[@name=$type_name] \
+ $all_types/ppx:dataTypes/ppx:dataType[@name=$type_name] \
""";
choose {
when "$datatype_infos" {