# HG changeset patch
# User Edouard Tisserant
# Date 1583412869 -3600
# Node ID 39c8d6079f0f6fd4b7f5e99d2b096347c291a8a3
# Parent a5c781b2f8f95b972d4bd88150ab969d8f0ce21d
SVGHMI: Fix disapearing elements in case of nested detachable elements.
diff -r a5c781b2f8f9 -r 39c8d6079f0f svghmi/gen_index_xhtml.xslt
--- a/svghmi/gen_index_xhtml.xslt Thu Mar 05 10:23:03 2020 +0100
+++ b/svghmi/gen_index_xhtml.xslt Thu Mar 05 13:54:29 2020 +0100
@@ -145,7 +145,8 @@
-
+
+
@@ -548,7 +549,7 @@
-
+
"
": {
diff -r a5c781b2f8f9 -r 39c8d6079f0f svghmi/gen_index_xhtml.ysl2
--- a/svghmi/gen_index_xhtml.ysl2 Thu Mar 05 10:23:03 2020 +0100
+++ b/svghmi/gen_index_xhtml.ysl2 Thu Mar 05 13:54:29 2020 +0100
@@ -260,9 +260,9 @@
}
}
- const "detachable_elements", "func:detachable_elements($hmi_pages)";
-
-
+ // Avoid nested detachables
+ const "_detachable_elements", "func:detachable_elements($hmi_pages)";
+ const "detachable_elements", "$_detachable_elements[not(ancestor::*/@id = $_detachable_elements/@id)]";
//////////////// HMI Tree Index
@@ -591,7 +591,11 @@
const "all_page_ids","$page_all_elements[@id = $hmi_elements/@id and @id != $page/@id]/@id";
- const "required_detachables", "func:sumarized_elements($page_all_elements)";
+ // Take closest ancestor in detachable_elements
+ // since nested detachable elements are filtered out
+ const "required_detachables",
+ """func:sumarized_elements($page_all_elements)/
+ ancestor-or-self::*[@id = $detachable_elements/@id]""";
| "«$desc/arg[1]/@value»": {
| widget: hmi_widgets["«@id»"],