svghmi/gen_index_xhtml.xslt
branchsvghmi
changeset 3031 440d74319a74
parent 3026 d454ed480c0f
child 3034 793ce2117258
equal deleted inserted replaced
3030:2d13a4379e2f 3031:440d74319a74
   635 </xsl:text>
   635 </xsl:text>
   636     </xsl:for-each>
   636     </xsl:for-each>
   637     <xsl:text>
   637     <xsl:text>
   638 </xsl:text>
   638 </xsl:text>
   639   </xsl:template>
   639   </xsl:template>
   640   <xsl:template mode="inline_svg" match="@* | node()">
   640   <xsl:template xmlns="http://www.w3.org/2000/svg" mode="inline_svg" match="@*">
       
   641     <xsl:copy/>
       
   642   </xsl:template>
       
   643   <xsl:template mode="inline_svg" match="node()">
   641     <xsl:if test="not(@id = $discardable_elements/@id)">
   644     <xsl:if test="not(@id = $discardable_elements/@id)">
   642       <xsl:copy>
   645       <xsl:copy>
   643         <xsl:apply-templates mode="inline_svg" select="@* | node()"/>
   646         <xsl:apply-templates mode="inline_svg" select="@* | node()"/>
   644       </xsl:copy>
   647       </xsl:copy>
   645     </xsl:if>
   648     </xsl:if>
   670       <xsl:text>All units must be set to "px" in Inkscape's document properties</xsl:text>
   673       <xsl:text>All units must be set to "px" in Inkscape's document properties</xsl:text>
   671     </xsl:message>
   674     </xsl:message>
   672   </xsl:template>
   675   </xsl:template>
   673   <xsl:variable name="hmi_lists_descs" select="$parsed_widgets/widget[@type = 'List']"/>
   676   <xsl:variable name="hmi_lists_descs" select="$parsed_widgets/widget[@type = 'List']"/>
   674   <xsl:variable name="hmi_lists" select="$hmi_elements[@id = $hmi_lists_descs/@id]"/>
   677   <xsl:variable name="hmi_lists" select="$hmi_elements[@id = $hmi_lists_descs/@id]"/>
   675   <xsl:variable name="targets_not_to_unlink" select="$hmi_elements[@id = $hmi_lists/@id]/descendant::svg:*"/>
   678   <xsl:variable name="targets_not_to_unlink" select="$hmi_lists/descendant-or-self::svg:*"/>
   676   <xsl:variable name="to_unlink" select="$hmi_elements[not(@id = $hmi_pages/@id)]/descendant-or-self::svg:use"/>
   679   <xsl:variable name="to_unlink" select="$hmi_elements[not(@id = $hmi_pages/@id)]/descendant-or-self::svg:use"/>
       
   680   <func:function name="func:is_unlinkable">
       
   681     <xsl:param name="targetid"/>
       
   682     <xsl:param name="eltid"/>
       
   683     <func:result select="$eltid = $to_unlink/@id and not($targetid = $targets_not_to_unlink/@id)"/>
       
   684   </func:function>
   677   <xsl:template xmlns="http://www.w3.org/2000/svg" mode="inline_svg" match="svg:use">
   685   <xsl:template xmlns="http://www.w3.org/2000/svg" mode="inline_svg" match="svg:use">
   678     <xsl:variable name="targetid" select="substring-after(@xlink:href,'#')"/>
   686     <xsl:variable name="targetid" select="substring-after(@xlink:href,'#')"/>
   679     <xsl:choose>
   687     <xsl:choose>
   680       <xsl:when test="@id = $to_unlink/@id and not($targetid = $targets_not_to_unlink/@id)">
   688       <xsl:when test="func:is_unlinkable($targetid, @id)">
   681         <xsl:call-template name="unlink_clone">
   689         <xsl:call-template name="unlink_clone">
   682           <xsl:with-param name="targetid" select="$targetid"/>
   690           <xsl:with-param name="targetid" select="$targetid"/>
   683         </xsl:call-template>
   691         </xsl:call-template>
   684       </xsl:when>
   692       </xsl:when>
   685       <xsl:otherwise>
   693       <xsl:otherwise>
   686         <xsl:copy>
   694         <xsl:copy>
   687           <xsl:apply-templates mode="inline_svg" select="@* | node()"/>
   695           <xsl:apply-templates mode="inline_svg" select="@*"/>
   688         </xsl:copy>
   696         </xsl:copy>
   689       </xsl:otherwise>
   697       </xsl:otherwise>
   690     </xsl:choose>
   698     </xsl:choose>
   691   </xsl:template>
   699   </xsl:template>
   692   <xsl:variable name="_excluded_use_attrs">
   700   <xsl:variable name="_excluded_use_attrs">
   703       <xsl:text>x</xsl:text>
   711       <xsl:text>x</xsl:text>
   704     </name>
   712     </name>
   705     <name>
   713     <name>
   706       <xsl:text>y</xsl:text>
   714       <xsl:text>y</xsl:text>
   707     </name>
   715     </name>
       
   716     <name>
       
   717       <xsl:text>id</xsl:text>
       
   718     </name>
   708   </xsl:variable>
   719   </xsl:variable>
   709   <xsl:variable name="excluded_use_attrs" select="exsl:node-set($_excluded_use_attrs)"/>
   720   <xsl:variable name="excluded_use_attrs" select="exsl:node-set($_excluded_use_attrs)"/>
   710   <xsl:variable name="_merge_use_attrs">
   721   <xsl:variable name="_merge_use_attrs">
   711     <name>
   722     <name>
   712       <xsl:text>transform</xsl:text>
   723       <xsl:text>transform</xsl:text>
   716     </name>
   727     </name>
   717   </xsl:variable>
   728   </xsl:variable>
   718   <xsl:variable name="merge_use_attrs" select="exsl:node-set($_merge_use_attrs)"/>
   729   <xsl:variable name="merge_use_attrs" select="exsl:node-set($_merge_use_attrs)"/>
   719   <xsl:template xmlns="http://www.w3.org/2000/svg" name="unlink_clone">
   730   <xsl:template xmlns="http://www.w3.org/2000/svg" name="unlink_clone">
   720     <xsl:param name="targetid"/>
   731     <xsl:param name="targetid"/>
       
   732     <xsl:param name="seed" select="''"/>
   721     <xsl:variable name="target" select="//svg:*[@id = $targetid]"/>
   733     <xsl:variable name="target" select="//svg:*[@id = $targetid]"/>
       
   734     <xsl:variable name="seeded_id">
       
   735       <xsl:choose>
       
   736         <xsl:when test="string-length($seed) &gt; 0">
       
   737           <xsl:value-of select="$seed"/>
       
   738           <xsl:text>_</xsl:text>
       
   739           <xsl:value-of select="@id"/>
       
   740         </xsl:when>
       
   741         <xsl:otherwise>
       
   742           <xsl:value-of select="@id"/>
       
   743         </xsl:otherwise>
       
   744       </xsl:choose>
       
   745     </xsl:variable>
   722     <g>
   746     <g>
       
   747       <xsl:attribute name="id">
       
   748         <xsl:value-of select="$seeded_id"/>
       
   749       </xsl:attribute>
       
   750       <xsl:attribute name="original">
       
   751         <xsl:value-of select="@id"/>
       
   752       </xsl:attribute>
   723       <xsl:choose>
   753       <xsl:choose>
   724         <xsl:when test="$target[self::svg:g]">
   754         <xsl:when test="$target[self::svg:g]">
   725           <xsl:for-each select="@*[not(local-name() = $excluded_use_attrs/name | $merge_use_attrs)]">
   755           <xsl:for-each select="@*[not(local-name() = $excluded_use_attrs/name | $merge_use_attrs)]">
   726             <xsl:attribute name="{name()}">
   756             <xsl:attribute name="{name()}">
   727               <xsl:value-of select="."/>
   757               <xsl:value-of select="."/>
   744               </xsl:if>
   774               </xsl:if>
   745               <xsl:value-of select="$target/@transform"/>
   775               <xsl:value-of select="$target/@transform"/>
   746             </xsl:attribute>
   776             </xsl:attribute>
   747           </xsl:if>
   777           </xsl:if>
   748           <xsl:apply-templates mode="unlink_clone" select="$target/*">
   778           <xsl:apply-templates mode="unlink_clone" select="$target/*">
   749             <xsl:with-param name="seed" select="@id"/>
   779             <xsl:with-param name="seed" select="$seeded_id"/>
   750           </xsl:apply-templates>
   780           </xsl:apply-templates>
   751         </xsl:when>
   781         </xsl:when>
   752         <xsl:otherwise>
   782         <xsl:otherwise>
   753           <xsl:for-each select="@*[not(local-name() = $excluded_use_attrs/name)]">
   783           <xsl:for-each select="@*[not(local-name() = $excluded_use_attrs/name)]">
   754             <xsl:attribute name="{name()}">
   784             <xsl:attribute name="{name()}">
   755               <xsl:value-of select="."/>
   785               <xsl:value-of select="."/>
   756             </xsl:attribute>
   786             </xsl:attribute>
   757           </xsl:for-each>
   787           </xsl:for-each>
   758           <xsl:apply-templates mode="unlink_clone" select="$target">
   788           <xsl:apply-templates mode="unlink_clone" select="$target">
   759             <xsl:with-param name="seed" select="@id"/>
   789             <xsl:with-param name="seed" select="$seeded_id"/>
   760           </xsl:apply-templates>
   790           </xsl:apply-templates>
   761         </xsl:otherwise>
   791         </xsl:otherwise>
   762       </xsl:choose>
   792       </xsl:choose>
   763     </g>
   793     </g>
   764   </xsl:template>
   794   </xsl:template>
   767     <xsl:attribute name="id">
   797     <xsl:attribute name="id">
   768       <xsl:value-of select="$seed"/>
   798       <xsl:value-of select="$seed"/>
   769       <xsl:text>_</xsl:text>
   799       <xsl:text>_</xsl:text>
   770       <xsl:value-of select="."/>
   800       <xsl:value-of select="."/>
   771     </xsl:attribute>
   801     </xsl:attribute>
       
   802     <xsl:attribute name="original">
       
   803       <xsl:value-of select="."/>
       
   804     </xsl:attribute>
   772   </xsl:template>
   805   </xsl:template>
   773   <xsl:template xmlns="http://www.w3.org/2000/svg" mode="unlink_clone" match="@*">
   806   <xsl:template xmlns="http://www.w3.org/2000/svg" mode="unlink_clone" match="@*">
   774     <xsl:copy/>
   807     <xsl:copy/>
       
   808   </xsl:template>
       
   809   <xsl:template xmlns="http://www.w3.org/2000/svg" mode="unlink_clone" match="svg:use">
       
   810     <xsl:param name="seed"/>
       
   811     <xsl:variable name="targetid" select="substring-after(@xlink:href,'#')"/>
       
   812     <xsl:choose>
       
   813       <xsl:when test="func:is_unlinkable($targetid, @id)">
       
   814         <xsl:call-template name="unlink_clone">
       
   815           <xsl:with-param name="targetid" select="$targetid"/>
       
   816           <xsl:with-param name="seed" select="$seed"/>
       
   817         </xsl:call-template>
       
   818       </xsl:when>
       
   819       <xsl:otherwise>
       
   820         <xsl:copy>
       
   821           <xsl:apply-templates mode="unlink_clone" select="@*">
       
   822             <xsl:with-param name="seed" select="$seed"/>
       
   823           </xsl:apply-templates>
       
   824         </xsl:copy>
       
   825       </xsl:otherwise>
       
   826     </xsl:choose>
   775   </xsl:template>
   827   </xsl:template>
   776   <xsl:template xmlns="http://www.w3.org/2000/svg" mode="unlink_clone" match="svg:*">
   828   <xsl:template xmlns="http://www.w3.org/2000/svg" mode="unlink_clone" match="svg:*">
   777     <xsl:param name="seed"/>
   829     <xsl:param name="seed"/>
   778     <xsl:choose>
   830     <xsl:choose>
   779       <xsl:when test="@id = $hmi_elements/@id">
   831       <xsl:when test="@id = $hmi_elements/@id">
  1022 </xsl:text>
  1074 </xsl:text>
  1023     <xsl:text>    }
  1075     <xsl:text>    }
  1024 </xsl:text>
  1076 </xsl:text>
  1025     <xsl:text>    let defaultval = local_defaults[varname];
  1077     <xsl:text>    let defaultval = local_defaults[varname];
  1026 </xsl:text>
  1078 </xsl:text>
  1027     <xsl:text>    console.log("page_local_index creat local", varname, pagename, new_index, defaultval);
       
  1028 </xsl:text>
       
  1029     <xsl:text>    if(defaultval != undefined) 
  1079     <xsl:text>    if(defaultval != undefined) 
  1030 </xsl:text>
  1080 </xsl:text>
  1031     <xsl:text>        cache[new_index] = defaultval; 
  1081     <xsl:text>        cache[new_index] = defaultval; 
  1032 </xsl:text>
  1082 </xsl:text>
  1033     <xsl:text>    return new_index;
  1083     <xsl:text>    return new_index;
  3363       <xsl:text>JsonTable Widget can't contain element of type </xsl:text>
  3413       <xsl:text>JsonTable Widget can't contain element of type </xsl:text>
  3364       <xsl:value-of select="local-name()"/>
  3414       <xsl:value-of select="local-name()"/>
  3365       <xsl:text>.</xsl:text>
  3415       <xsl:text>.</xsl:text>
  3366     </xsl:message>
  3416     </xsl:message>
  3367   </xsl:template>
  3417   </xsl:template>
       
  3418   <xsl:variable name="hmi_textstylelists_descs" select="$parsed_widgets/widget[@type = 'TextStyleList']"/>
       
  3419   <xsl:variable name="hmi_textstylelists" select="$hmi_elements[@id = $hmi_textstylelists_descs/@id]"/>
       
  3420   <xsl:variable name="textstylelist_related">
       
  3421     <xsl:for-each select="$hmi_textstylelists">
       
  3422       <list>
       
  3423         <xsl:attribute name="listid">
       
  3424           <xsl:value-of select="@id"/>
       
  3425         </xsl:attribute>
       
  3426         <xsl:for-each select="func:refered_elements(.)">
       
  3427           <elt>
       
  3428             <xsl:attribute name="eltid">
       
  3429               <xsl:value-of select="@id"/>
       
  3430             </xsl:attribute>
       
  3431           </elt>
       
  3432         </xsl:for-each>
       
  3433       </list>
       
  3434     </xsl:for-each>
       
  3435   </xsl:variable>
       
  3436   <xsl:variable name="textstylelist_related_ns" select="exsl:node-set($textstylelist_related)"/>
       
  3437   <func:function name="func:json_expressions">
       
  3438     <xsl:param name="expressions"/>
       
  3439     <xsl:param name="label"/>
       
  3440     <xsl:choose>
       
  3441       <xsl:when test="$label">
       
  3442         <xsl:variable name="suffixes" select="str:split($label)"/>
       
  3443         <xsl:variable name="res">
       
  3444           <xsl:for-each select="$suffixes">
       
  3445             <expression>
       
  3446               <xsl:variable name="suffix" select="."/>
       
  3447               <xsl:variable name="pos" select="position()"/>
       
  3448               <xsl:variable name="expr" select="$expressions[position() &lt;= $pos][last()]/expression"/>
       
  3449               <xsl:choose>
       
  3450                 <xsl:when test="contains($suffix,'=')">
       
  3451                   <xsl:variable name="name" select="substring-before($suffix,'=')"/>
       
  3452                   <xsl:if test="$expr/@name[. != $name]">
       
  3453                     <xsl:message terminate="yes">
       
  3454                       <xsl:text>JsonTable : missplaced '=' or inconsistent names in Json data expressions.</xsl:text>
       
  3455                     </xsl:message>
       
  3456                   </xsl:if>
       
  3457                   <xsl:attribute name="name">
       
  3458                     <xsl:value-of select="$name"/>
       
  3459                   </xsl:attribute>
       
  3460                   <xsl:attribute name="content">
       
  3461                     <xsl:value-of select="$expr/@content"/>
       
  3462                     <xsl:value-of select="substring-after($suffix,'=')"/>
       
  3463                   </xsl:attribute>
       
  3464                 </xsl:when>
       
  3465                 <xsl:otherwise>
       
  3466                   <xsl:copy-of select="$expr/@name"/>
       
  3467                   <xsl:attribute name="content">
       
  3468                     <xsl:value-of select="$expr/@content"/>
       
  3469                     <xsl:value-of select="$suffix"/>
       
  3470                   </xsl:attribute>
       
  3471                 </xsl:otherwise>
       
  3472               </xsl:choose>
       
  3473             </expression>
       
  3474           </xsl:for-each>
       
  3475         </xsl:variable>
       
  3476         <func:result select="exsl:node-set($res)"/>
       
  3477       </xsl:when>
       
  3478       <xsl:otherwise>
       
  3479         <func:result select="$expressions"/>
       
  3480       </xsl:otherwise>
       
  3481     </xsl:choose>
       
  3482   </func:function>
       
  3483   <xsl:variable name="initexpr">
       
  3484     <expression>
       
  3485       <xsl:attribute name="content">
       
  3486         <xsl:text>jdata</xsl:text>
       
  3487       </xsl:attribute>
       
  3488     </expression>
       
  3489   </xsl:variable>
       
  3490   <xsl:variable name="initexpr_ns" select="exsl:node-set($initexpr)"/>
  3368   <xsl:template mode="json_table_elt_render" match="svg:use">
  3491   <xsl:template mode="json_table_elt_render" match="svg:use">
  3369     <xsl:param name="value_expr"/>
  3492     <xsl:param name="expressions"/>
  3370     <xsl:variable name="targetid" select="substring-after(@xlink:href,'#')"/>
  3493     <xsl:variable name="targetid" select="substring-after(@xlink:href,'#')"/>
  3371     <xsl:variable name="from_list" select="$hmi_lists[(@id | */@id) = $targetid]"/>
  3494     <xsl:variable name="from_list" select="$hmi_lists[(@id | */@id) = $targetid]"/>
  3372     <xsl:if test="count($from_list) = 0">
  3495     <xsl:choose>
  3373       <xsl:message terminate="yes">
  3496       <xsl:when test="count($from_list) &gt; 0">
  3374         <xsl:text>Clones (svg:use) in JsonTable Widget must point to a valid HMI:List widget or HMI:List item. Reference "</xsl:text>
  3497         <xsl:text>        id("</xsl:text>
  3375         <xsl:value-of select="@xlink:href"/>
  3498         <xsl:value-of select="@id"/>
  3376         <xsl:text>" is not valid.</xsl:text>
  3499         <xsl:text>").setAttribute("xlink:href", 
  3377       </xsl:message>
  3500 </xsl:text>
  3378     </xsl:if>
  3501         <xsl:text>            "#"+hmi_widgets["</xsl:text>
  3379     <xsl:text>        id("</xsl:text>
  3502         <xsl:value-of select="$from_list/@id"/>
  3380     <xsl:value-of select="@id"/>
  3503         <xsl:text>"].items[</xsl:text>
  3381     <xsl:text>").setAttribute("xlink:href", 
  3504         <xsl:value-of select="$expressions/expression[1]/@content"/>
  3382 </xsl:text>
  3505         <xsl:text>]);
  3383     <xsl:text>            "#"+hmi_widgets["</xsl:text>
  3506 </xsl:text>
  3384     <xsl:value-of select="$from_list/@id"/>
  3507       </xsl:when>
  3385     <xsl:text>"].items[</xsl:text>
  3508       <xsl:otherwise>
  3386     <xsl:value-of select="$value_expr"/>
  3509         <xsl:message terminate="no">
  3387     <xsl:text>]);
  3510           <xsl:text>Clones (svg:use) in JsonTable Widget must point to a valid HMI:List widget or item. Reference "</xsl:text>
  3388 </xsl:text>
  3511           <xsl:value-of select="@xlink:href"/>
       
  3512           <xsl:text>" is not valid and will not be updated.</xsl:text>
       
  3513         </xsl:message>
       
  3514       </xsl:otherwise>
       
  3515     </xsl:choose>
  3389   </xsl:template>
  3516   </xsl:template>
  3390   <xsl:template mode="json_table_elt_render" match="svg:text">
  3517   <xsl:template mode="json_table_elt_render" match="svg:text">
  3391     <xsl:param name="value_expr"/>
  3518     <xsl:param name="expressions"/>
  3392     <xsl:text>        id("</xsl:text>
  3519     <xsl:variable name="value_expr" select="$expressions/expression[1]/@content"/>
  3393     <xsl:value-of select="@id"/>
  3520     <xsl:variable name="original" select="@original"/>
  3394     <xsl:text>").textContent = String(</xsl:text>
  3521     <xsl:variable name="from_textstylelist" select="$textstylelist_related_ns/list[elt/@eltid = $original]"/>
  3395     <xsl:value-of select="$value_expr"/>
  3522     <xsl:choose>
  3396     <xsl:text>);
  3523       <xsl:when test="count($from_textstylelist) &gt; 0">
  3397 </xsl:text>
  3524         <xsl:variable name="content_expr" select="$expressions/expression[2]/@content"/>
  3398   </xsl:template>
  3525         <xsl:if test="string-length($content_expr) = 0 or $expressions/expression[2]/@name != 'textContent'">
       
  3526           <xsl:message terminate="yes">
       
  3527             <xsl:text>Clones (svg:use) in JsonTable Widget pointing to a HMI:TextStyleList widget or item must have a "textContent=.someVal" assignement following value expression in label.</xsl:text>
       
  3528           </xsl:message>
       
  3529         </xsl:if>
       
  3530         <xsl:text>        {
       
  3531 </xsl:text>
       
  3532         <xsl:text>          let elt = id("</xsl:text>
       
  3533         <xsl:value-of select="@id"/>
       
  3534         <xsl:text>");
       
  3535 </xsl:text>
       
  3536         <xsl:text>          elt.textContent = String(</xsl:text>
       
  3537         <xsl:value-of select="$content_expr"/>
       
  3538         <xsl:text>);
       
  3539 </xsl:text>
       
  3540         <xsl:text>          elt.style = hmi_widgets["</xsl:text>
       
  3541         <xsl:value-of select="$from_textstylelist/@listid"/>
       
  3542         <xsl:text>"].styles[</xsl:text>
       
  3543         <xsl:value-of select="$value_expr"/>
       
  3544         <xsl:text>];
       
  3545 </xsl:text>
       
  3546         <xsl:text>        }
       
  3547 </xsl:text>
       
  3548       </xsl:when>
       
  3549       <xsl:otherwise>
       
  3550         <xsl:text>        id("</xsl:text>
       
  3551         <xsl:value-of select="@id"/>
       
  3552         <xsl:text>").textContent = String(</xsl:text>
       
  3553         <xsl:value-of select="$value_expr"/>
       
  3554         <xsl:text>);
       
  3555 </xsl:text>
       
  3556       </xsl:otherwise>
       
  3557     </xsl:choose>
       
  3558   </xsl:template>
       
  3559   <func:function name="func:filter_non_widget_label">
       
  3560     <xsl:param name="elt"/>
       
  3561     <xsl:param name="widget_elts"/>
       
  3562     <xsl:variable name="eltid">
       
  3563       <xsl:choose>
       
  3564         <xsl:when test="$elt/@original">
       
  3565           <xsl:value-of select="$elt/@original"/>
       
  3566         </xsl:when>
       
  3567         <xsl:otherwise>
       
  3568           <xsl:value-of select="$elt/@id"/>
       
  3569         </xsl:otherwise>
       
  3570       </xsl:choose>
       
  3571     </xsl:variable>
       
  3572     <func:result select="$widget_elts[@id=$eltid]/@inkscape:label"/>
       
  3573   </func:function>
  3399   <xsl:template mode="json_table_render" match="svg:*">
  3574   <xsl:template mode="json_table_render" match="svg:*">
  3400     <xsl:param name="objname"/>
  3575     <xsl:param name="expressions"/>
       
  3576     <xsl:param name="widget_elts"/>
       
  3577     <xsl:variable name="label" select="func:filter_non_widget_label(., $widget_elts)"/>
  3401     <xsl:apply-templates mode="json_table_elt_render" select=".">
  3578     <xsl:apply-templates mode="json_table_elt_render" select=".">
  3402       <xsl:with-param name="value_expr">
  3579       <xsl:with-param name="expressions" select="func:json_expressions($expressions, $label)"/>
  3403         <xsl:value-of select="$objname"/>
       
  3404         <xsl:value-of select="@inkscape:label"/>
       
  3405       </xsl:with-param>
       
  3406     </xsl:apply-templates>
  3580     </xsl:apply-templates>
  3407   </xsl:template>
  3581   </xsl:template>
  3408   <xsl:template mode="json_table_render" match="svg:g">
  3582   <xsl:template mode="json_table_render" match="svg:g">
  3409     <xsl:param name="objname"/>
  3583     <xsl:param name="expressions"/>
  3410     <xsl:text>        let obj_</xsl:text>
  3584     <xsl:param name="widget_elts"/>
  3411     <xsl:value-of select="@id"/>
  3585     <xsl:variable name="label" select="func:filter_non_widget_label(., $widget_elts)"/>
  3412     <xsl:text> = </xsl:text>
  3586     <xsl:apply-templates mode="json_table_render" select="*">
  3413     <xsl:value-of select="$objname"/>
  3587       <xsl:with-param name="expressions" select="func:json_expressions($expressions, $label)"/>
  3414     <xsl:value-of select="@inkscape:label"/>
  3588       <xsl:with-param name="widget_elts" select="$widget_elts"/>
  3415     <xsl:text>;
       
  3416 </xsl:text>
       
  3417     <xsl:apply-templates mode="json_table_render" select="*[@inkscape:label]">
       
  3418       <xsl:with-param name="objname">
       
  3419         <xsl:text>obj_</xsl:text>
       
  3420         <xsl:value-of select="@id"/>
       
  3421       </xsl:with-param>
       
  3422     </xsl:apply-templates>
  3589     </xsl:apply-templates>
  3423   </xsl:template>
  3590   </xsl:template>
  3424   <xsl:template mode="widget_defs" match="widget[@type='JsonTable']">
  3591   <xsl:template mode="widget_defs" match="widget[@type='JsonTable']">
  3425     <xsl:param name="hmi_element"/>
  3592     <xsl:param name="hmi_element"/>
  3426     <xsl:call-template name="defs_by_labels">
  3593     <xsl:call-template name="defs_by_labels">
  3438     </xsl:call-template>
  3605     </xsl:call-template>
  3439     <xsl:variable name="data_elt" select="$result_svg_ns//*[@id = $hmi_element/@id]/*[@inkscape:label = 'data']"/>
  3606     <xsl:variable name="data_elt" select="$result_svg_ns//*[@id = $hmi_element/@id]/*[@inkscape:label = 'data']"/>
  3440     <xsl:text>    spread_json_data: function(jdata) {
  3607     <xsl:text>    spread_json_data: function(jdata) {
  3441 </xsl:text>
  3608 </xsl:text>
  3442     <xsl:apply-templates mode="json_table_render" select="$data_elt/*">
  3609     <xsl:apply-templates mode="json_table_render" select="$data_elt/*">
  3443       <xsl:with-param name="objname" select="'jdata'"/>
  3610       <xsl:with-param name="expressions" select="$initexpr_ns"/>
       
  3611       <xsl:with-param name="widget_elts" select="$hmi_element/*[@inkscape:label = 'data']/descendant::svg:*"/>
  3444     </xsl:apply-templates>
  3612     </xsl:apply-templates>
  3445     <xsl:text>    }
  3613     <xsl:text>    }
  3446 </xsl:text>
  3614 </xsl:text>
  3447   </xsl:template>
  3615   </xsl:template>
  3448   <xsl:template name="jump_widget_activity">
  3616   <xsl:template name="jump_widget_activity">
  4077     <xsl:param name="hmi_element"/>
  4245     <xsl:param name="hmi_element"/>
  4078     <xsl:text>    items: {
  4246     <xsl:text>    items: {
  4079 </xsl:text>
  4247 </xsl:text>
  4080     <xsl:for-each select="$hmi_element/*[@inkscape:label]">
  4248     <xsl:for-each select="$hmi_element/*[@inkscape:label]">
  4081       <xsl:text>        </xsl:text>
  4249       <xsl:text>        </xsl:text>
  4082       <xsl:value-of select="func:escape_quotes(@inkscape:label)"/>
  4250       <xsl:value-of select="@inkscape:label"/>
  4083       <xsl:text>: "</xsl:text>
  4251       <xsl:text>: "</xsl:text>
  4084       <xsl:value-of select="@id"/>
  4252       <xsl:value-of select="@id"/>
       
  4253       <xsl:text>",
       
  4254 </xsl:text>
       
  4255     </xsl:for-each>
       
  4256     <xsl:text>    },
       
  4257 </xsl:text>
       
  4258   </xsl:template>
       
  4259   <xsl:template mode="widget_defs" match="widget[@type='TextStyleList']">
       
  4260     <xsl:param name="hmi_element"/>
       
  4261     <xsl:text>    styles: {
       
  4262 </xsl:text>
       
  4263     <xsl:for-each select="$hmi_element/*[@inkscape:label]">
       
  4264       <xsl:variable name="style" select="func:refered_elements(.)[self::svg:text]/@style"/>
       
  4265       <xsl:text>        </xsl:text>
       
  4266       <xsl:value-of select="@inkscape:label"/>
       
  4267       <xsl:text>: "</xsl:text>
       
  4268       <xsl:value-of select="$style"/>
  4085       <xsl:text>",
  4269       <xsl:text>",
  4086 </xsl:text>
  4270 </xsl:text>
  4087     </xsl:for-each>
  4271     </xsl:for-each>
  4088     <xsl:text>    },
  4272     <xsl:text>    },
  4089 </xsl:text>
  4273 </xsl:text>