--- a/svghmi/parse_labels.ysl2 Tue Apr 13 21:00:34 2021 +0200
+++ b/svghmi/parse_labels.ysl2 Tue Apr 13 21:04:46 2021 +0200
@@ -54,7 +54,7 @@
error > Widget id:«$id» label:«$label» has wrong syntax of path section «$pathminmax»
}
}
- choose {
+ if "$indexed_hmitree" choose {
when "regexp:test($path,'^\.[a-zA-Z0-9_]+$')" {
attrib "type" > PAGE_LOCAL
}
@@ -78,3 +78,18 @@
}
}
+
+// Templates to generate label back from parsed tree
+template "arg", mode="genlabel" > :«@value»
+
+template "path", mode="genlabel" {
+ > @«@value»
+ if "string-length(@min)>0 or string-length(@max)>0" > :«@min»:«@max»
+}
+
+template "widget", mode="genlabel" {
+ > HMI:«@type»
+ apply "arg", mode="genlabel";
+ apply "path", mode="genlabel";
+}
+