svghmi/widget_switch.ysl2
branchsvghmi
changeset 3220 ec365ef396b1
parent 2969 88988edb2e93
child 3232 7bdb766c2a4d
--- a/svghmi/widget_switch.ysl2	Thu Apr 01 15:57:06 2021 +0200
+++ b/svghmi/widget_switch.ysl2	Thu Apr 01 16:00:58 2021 +0200
@@ -20,7 +20,12 @@
     param "hmi_element";
     |     choices: [
     const "regex",!"'^(\"[^\"].*\"|\-?[0-9]+|false|true)(#.*)?$'"!;
-    foreach "$result_svg_ns//*[@id = $hmi_element/@id]//*[regexp:test(@inkscape:label,$regex)]" {
+
+    const "subelts", "$result_widgets[@id = $hmi_element/@id]//*";
+    const "subwidgets", "$subelts//*[@id = $hmi_widgets/@id]";
+    const "accepted", "$subelts[not(ancestor-or-self::*/@id = $subwidgets/@id)]";
+
+    foreach "$accepted[regexp:test(@inkscape:label,$regex)]" {
         const "literal", "regexp:match(@inkscape:label,$regex)[2]";
     |         {
     |             elt:id("«@id»"),