13 // path value="path4" index="path4" type="HMI_LOCAL"; |
13 // path value="path4" index="path4" type="HMI_LOCAL"; |
14 // } |
14 // } |
15 // |
15 // |
16 const "pathregex",!"'^([^\[,]+)(\[[^\]]+\])?([-.\d,]*)$'"!; |
16 const "pathregex",!"'^([^\[,]+)(\[[^\]]+\])?([-.\d,]*)$'"!; |
17 |
17 |
|
18 const "newline" | |
|
19 const "twonewlines", "concat($newline,$newline)"; |
|
20 |
18 template "*", mode="parselabel" |
21 template "*", mode="parselabel" |
19 { |
22 { |
20 const "label","@inkscape:label"; |
23 const "part","@inkscape:label"; |
|
24 const "desc", "svg:desc"; |
|
25 |
|
26 // add svg:desc field if continuation "\" marker is found at the end of label |
|
27 const "len","string-length($part)"; |
|
28 const "has_continuation", "substring($part,$len,1)='\\'"; |
|
29 const "label" choose{ |
|
30 when "$has_continuation" { |
|
31 const "_continuation", "substring-before($desc, $twonewlines)"; |
|
32 const "continuation" choose { |
|
33 when "$_continuation" value "$_continuation"; |
|
34 otherwise value "$desc"; |
|
35 } |
|
36 value "concat(substring($part,1,$len - 1),translate($continuation,$newline,''))"; |
|
37 } |
|
38 otherwise value "$part"; |
|
39 } |
|
40 |
21 const "id","@id"; |
41 const "id","@id"; |
22 |
42 |
23 const "description", "substring-after($label,'HMI:')"; |
43 const "description", "substring-after($label,'HMI:')"; |
24 |
44 |
25 const "_args", "substring-before($description,'@')"; |
45 const "_args", "substring-before($description,'@')"; |