50 with "index", "$index + count(exsl:node-set($content)/*)"; |
50 with "index", "$index + count(exsl:node-set($content)/*)"; |
51 with "parentpath" > «$parentpath» |
51 with "parentpath" > «$parentpath» |
52 } |
52 } |
53 } |
53 } |
54 |
54 |
|
55 def "func:get_hmi_tree_elt" { |
|
56 param "path"; |
|
57 param "root", "$hmitree"; |
|
58 message > get_hmi_tree_elt «$path» |
|
59 if "not(starts-with($path, '/'))" error > Given path "«$path»" should start with a "/" |
|
60 const "stripped", "substring($path, 2)"; |
|
61 const "token" choose { |
|
62 when "contains($stripped, '/')" value "substring-before($stripped, '/')"; |
|
63 otherwise value "$stripped"; |
|
64 } |
|
65 |
|
66 choose { |
|
67 when "string-length($token) = 0"{ |
|
68 result "$root"; |
|
69 } |
|
70 otherwise{ |
|
71 const "rest", "substring-after($stripped, $token)"; |
|
72 const "match", "$root/*[@name = $token]"; |
|
73 choose { |
|
74 when "string-length($rest) > 0"{ |
|
75 result "func:get_hmi_tree_el($rest, $match)"; |
|
76 } |
|
77 otherwise{ |
|
78 result "$match"; |
|
79 } |
|
80 } |
|
81 } |
|
82 } |
|
83 } |
|
84 |
55 // Parses: |
85 // Parses: |
56 // "HMI:WidgetType:param1:param2@path1@path2" |
86 // "HMI:WidgetType:param1:param2@path1@path2" |
57 // |
87 // |
58 // Into: |
88 // Into: |
59 // widget type="WidgetType" { |
89 // widget type="WidgetType" id="blah456" { |
60 // arg value="param1"; |
90 // arg value="param1"; |
61 // arg value="param2"; |
91 // arg value="param2"; |
62 // path value="path1"; |
92 // path value="path1" index="345"; |
63 // path value="path2"; |
93 // path value="path2"; |
64 // } |
94 // } |
65 // |
95 // |
66 template "*", mode="parselabel" { |
96 template "*", mode="parselabel" { |
67 const "label","@inkscape:label"; |
97 const "label","@inkscape:label"; |