svghmi/hmi_tree.ysl2
branchsvghmi
changeset 3017 15e2df3e5610
parent 2941 ef13a4007538
child 3060 4d20b92282e3
--- a/svghmi/hmi_tree.ysl2	Thu Aug 06 15:01:01 2020 +0200
+++ b/svghmi/hmi_tree.ysl2	Sat Aug 08 15:53:28 2020 +0200
@@ -107,9 +107,21 @@
                 attrib "value" > «.»
                 const "path", ".";
                 const "item", "$indexed_hmitree/*[@hmipath = $path]";
-                if "count($item) = 1" {
-                    attrib "index" > «$item/@index»
-                    attrib "type" > «local-name($item)»
+                choose {
+                    when "count($item) = 1" {
+                        attrib "index" > «$item/@index»
+                        attrib "type" > «local-name($item)»
+                    }
+                    otherwise {
+                        choose {
+                            when "regexp:test($path,'^\.[a-zA-Z0-9_]+')" {
+                                attrib "type" > PAGE_LOCAL
+                            }
+                            when "regexp:test($path,'^[a-zA-Z0-9_]+')" {
+                                attrib "type" > HMI_LOCAL
+                            }
+                        }
+                    }
                 }
             }
         }