svghmi/widgets_common.ysl2
changeset 3452 a0bd2c4cb8f7
parent 3417 9b9775d230f5
child 3453 e5967a2ae2bb
equal deleted inserted replaced
3451:302efcf746e0 3452:a0bd2c4cb8f7
   393     param "mandatory","'yes'";
   393     param "mandatory","'yes'";
   394     param "subelements","/..";
   394     param "subelements","/..";
   395     param "hmi_element";
   395     param "hmi_element";
   396     const "widget_type","@type";
   396     const "widget_type","@type";
   397     foreach "str:split($labels)" {
   397     foreach "str:split($labels)" {
   398         const "name",".";
   398         const "absolute", "starts-with(., '/')";
   399         const "elt","$result_widgets[@id = $hmi_element/@id]//*[@inkscape:label=$name][1]";
   399         const "name","substring(.,number($absolute)+1)";
       
   400         const "widget","$result_widgets[@id = $hmi_element/@id]";
       
   401         const "elt","($widget//*[not($absolute) and @inkscape:label=$name] | $widget/*[$absolute and @inkscape:label=$name])[1]";
   400         choose {
   402         choose {
   401             when "not($elt/@id)" {
   403             when "not($elt/@id)" {
   402                 if "$mandatory='yes'" {
   404                 if "$mandatory='yes'" {
   403                     error > «$widget_type» widget must have a «$name» element
   405                     error > «$widget_type» widget must have a «$name» element
   404                 }
   406                 }