svghmi/gen_index_xhtml.xslt
branchsvghmi
changeset 3165 2db69e2c5673
parent 3161 edd558965f58
child 3170 aaa203270ab0
equal deleted inserted replaced
3164:ea4a61b4a325 3165:2db69e2c5673
    17     <xsl:apply-templates mode="index" select="$hmitree"/>
    17     <xsl:apply-templates mode="index" select="$hmitree"/>
    18   </xsl:variable>
    18   </xsl:variable>
    19   <xsl:variable name="indexed_hmitree" select="exsl:node-set($_indexed_hmitree)"/>
    19   <xsl:variable name="indexed_hmitree" select="exsl:node-set($_indexed_hmitree)"/>
    20   <preamble:hmi-tree/>
    20   <preamble:hmi-tree/>
    21   <xsl:template match="preamble:hmi-tree">
    21   <xsl:template match="preamble:hmi-tree">
    22     <xsl:variable name="_unused" select="ns:ProgressStart(name())"/>
       
    23     <xsl:text>
    22     <xsl:text>
    24 </xsl:text>
    23 </xsl:text>
    25     <xsl:text>/* </xsl:text>
    24     <xsl:text>/* </xsl:text>
    26     <xsl:value-of select="local-name()"/>
    25     <xsl:value-of select="local-name()"/>
    27     <xsl:text> */
    26     <xsl:text> */
    60 </xsl:text>
    59 </xsl:text>
    61     <xsl:text>
    60     <xsl:text>
    62 </xsl:text>
    61 </xsl:text>
    63     <xsl:text>
    62     <xsl:text>
    64 </xsl:text>
    63 </xsl:text>
    65     <xsl:variable name="__unused" select="ns:ProgressEnd(name())"/>
       
    66   </xsl:template>
    64   </xsl:template>
    67   <xsl:template mode="index" match="*">
    65   <xsl:template mode="index" match="*">
    68     <xsl:param name="index" select="0"/>
    66     <xsl:param name="index" select="0"/>
    69     <xsl:param name="parentpath" select="''"/>
    67     <xsl:param name="parentpath" select="''"/>
    70     <xsl:variable name="content">
    68     <xsl:variable name="content">
   278       </xsl:with-param>
   276       </xsl:with-param>
   279     </xsl:apply-templates>
   277     </xsl:apply-templates>
   280   </xsl:template>
   278   </xsl:template>
   281   <debug:hmi-tree/>
   279   <debug:hmi-tree/>
   282   <xsl:template match="debug:hmi-tree">
   280   <xsl:template match="debug:hmi-tree">
   283     <xsl:variable name="_unused" select="ns:ProgressStart(name())"/>
       
   284     <xsl:text>
   281     <xsl:text>
   285 </xsl:text>
   282 </xsl:text>
   286     <xsl:text>/* </xsl:text>
   283     <xsl:text>/* </xsl:text>
   287     <xsl:value-of select="local-name()"/>
   284     <xsl:value-of select="local-name()"/>
   288     <xsl:text> */
   285     <xsl:text> */
   303 </xsl:text>
   300 </xsl:text>
   304     <xsl:copy-of select="_parsed_widgets"/>
   301     <xsl:copy-of select="_parsed_widgets"/>
   305     <xsl:apply-templates mode="testtree" select="$parsed_widgets"/>
   302     <xsl:apply-templates mode="testtree" select="$parsed_widgets"/>
   306     <xsl:text>
   303     <xsl:text>
   307 </xsl:text>
   304 </xsl:text>
   308     <xsl:variable name="__unused" select="ns:ProgressEnd(name())"/>
       
   309   </xsl:template>
   305   </xsl:template>
   310   <xsl:variable name="geometry" select="ns:GetSVGGeometry()"/>
   306   <xsl:variable name="geometry" select="ns:GetSVGGeometry()"/>
   311   <debug:geometry/>
   307   <debug:geometry/>
   312   <xsl:template match="debug:geometry">
   308   <xsl:template match="debug:geometry">
   313     <xsl:variable name="_unused" select="ns:ProgressStart(name())"/>
       
   314     <xsl:text>
   309     <xsl:text>
   315 </xsl:text>
   310 </xsl:text>
   316     <xsl:text>/* </xsl:text>
   311     <xsl:text>/* </xsl:text>
   317     <xsl:value-of select="local-name()"/>
   312     <xsl:value-of select="local-name()"/>
   318     <xsl:text> */
   313     <xsl:text> */
   335       <xsl:text>
   330       <xsl:text>
   336 </xsl:text>
   331 </xsl:text>
   337     </xsl:for-each>
   332     </xsl:for-each>
   338     <xsl:text>
   333     <xsl:text>
   339 </xsl:text>
   334 </xsl:text>
   340     <xsl:variable name="__unused" select="ns:ProgressEnd(name())"/>
       
   341   </xsl:template>
   335   </xsl:template>
   342   <func:function name="func:intersect_1d">
   336   <func:function name="func:intersect_1d">
   343     <xsl:param name="a0"/>
   337     <xsl:param name="a0"/>
   344     <xsl:param name="a1"/>
   338     <xsl:param name="a1"/>
   345     <xsl:param name="b0"/>
   339     <xsl:param name="b0"/>
   376       <xsl:otherwise>
   370       <xsl:otherwise>
   377         <func:result select="0"/>
   371         <func:result select="0"/>
   378       </xsl:otherwise>
   372       </xsl:otherwise>
   379     </xsl:choose>
   373     </xsl:choose>
   380   </func:function>
   374   </func:function>
       
   375   <xsl:variable name="groups" select="/svg:svg | //svg:g"/>
   381   <func:function name="func:overlapping_geometry">
   376   <func:function name="func:overlapping_geometry">
   382     <xsl:param name="elt"/>
   377     <xsl:param name="elt"/>
   383     <xsl:variable name="groups" select="/svg:svg | //svg:g"/>
       
   384     <xsl:variable name="g" select="$geometry[@Id = $elt/@id]"/>
   378     <xsl:variable name="g" select="$geometry[@Id = $elt/@id]"/>
   385     <xsl:variable name="candidates" select="$geometry[@Id != $elt/@id]"/>
   379     <xsl:variable name="candidates" select="$geometry[@Id != $elt/@id]"/>
   386     <func:result select="$candidates[(@Id = $groups/@id and (func:intersect($g, .) = 9)) or &#10;                          (not(@Id = $groups/@id) and (func:intersect($g, .) &gt; 0 ))]"/>
   380     <func:result select="$candidates[(@Id = $groups/@id and (func:intersect($g, .) = 9)) or &#10;                          (not(@Id = $groups/@id) and (func:intersect($g, .) &gt; 0 ))]"/>
   387   </func:function>
   381   </func:function>
   388   <xsl:variable name="hmi_pages_descs" select="$parsed_widgets/widget[@type = 'Page']"/>
   382   <xsl:variable name="hmi_pages_descs" select="$parsed_widgets/widget[@type = 'Page']"/>
   411       </xsl:otherwise>
   405       </xsl:otherwise>
   412     </xsl:choose>
   406     </xsl:choose>
   413   </xsl:variable>
   407   </xsl:variable>
   414   <preamble:default-page/>
   408   <preamble:default-page/>
   415   <xsl:template match="preamble:default-page">
   409   <xsl:template match="preamble:default-page">
   416     <xsl:variable name="_unused" select="ns:ProgressStart(name())"/>
       
   417     <xsl:text>
   410     <xsl:text>
   418 </xsl:text>
   411 </xsl:text>
   419     <xsl:text>/* </xsl:text>
   412     <xsl:text>/* </xsl:text>
   420     <xsl:value-of select="local-name()"/>
   413     <xsl:value-of select="local-name()"/>
   421     <xsl:text> */
   414     <xsl:text> */
   428     <xsl:value-of select="$default_page"/>
   421     <xsl:value-of select="$default_page"/>
   429     <xsl:text>";
   422     <xsl:text>";
   430 </xsl:text>
   423 </xsl:text>
   431     <xsl:text>
   424     <xsl:text>
   432 </xsl:text>
   425 </xsl:text>
   433     <xsl:variable name="__unused" select="ns:ProgressEnd(name())"/>
       
   434   </xsl:template>
   426   </xsl:template>
   435   <xsl:variable name="keypads_descs" select="$parsed_widgets/widget[@type = 'Keypad']"/>
   427   <xsl:variable name="keypads_descs" select="$parsed_widgets/widget[@type = 'Keypad']"/>
   436   <xsl:variable name="keypads" select="$hmi_elements[@id = $keypads_descs/@id]"/>
   428   <xsl:variable name="keypads" select="$hmi_elements[@id = $keypads_descs/@id]"/>
   437   <func:function name="func:refered_elements">
   429   <func:function name="func:refered_elements">
   438     <xsl:param name="elems"/>
   430     <xsl:param name="elems"/>
   446       <xsl:otherwise>
   438       <xsl:otherwise>
   447         <func:result select="$descend"/>
   439         <func:result select="$descend"/>
   448       </xsl:otherwise>
   440       </xsl:otherwise>
   449     </xsl:choose>
   441     </xsl:choose>
   450   </func:function>
   442   </func:function>
       
   443   <xsl:variable name="_overlapping_geometry">
       
   444     <xsl:variable name="k" select="'overlapping'"/>
       
   445     <xsl:variable name="m" select="'computing belonging of widgets to pages'"/>
       
   446     <xsl:value-of select="ns:ProgressStart($k, $m)"/>
       
   447     <xsl:for-each select="$hmi_pages | $keypads">
       
   448       <xsl:variable name="k2" select="concat('overlapping:', @id)"/>
       
   449       <xsl:variable name="m2" select="concat('collecting membership of ', @inkscape:label)"/>
       
   450       <xsl:value-of select="ns:ProgressStart($k2, $m2)"/>
       
   451       <elt>
       
   452         <xsl:attribute name="id">
       
   453           <xsl:value-of select="@id"/>
       
   454         </xsl:attribute>
       
   455         <xsl:copy-of select="func:overlapping_geometry(.)"/>
       
   456       </elt>
       
   457       <xsl:value-of select="ns:ProgressEnd($k2, $m2)"/>
       
   458     </xsl:for-each>
       
   459     <xsl:value-of select="ns:ProgressEnd($k, $m)"/>
       
   460   </xsl:variable>
       
   461   <xsl:variable name="overlapping_geometry" select="exsl:node-set($_overlapping_geometry)"/>
   451   <func:function name="func:all_related_elements">
   462   <func:function name="func:all_related_elements">
   452     <xsl:param name="page"/>
   463     <xsl:param name="page"/>
   453     <xsl:variable name="page_overlapping_geometry" select="func:overlapping_geometry($page)"/>
   464     <xsl:variable name="page_overlapping_geometry" select="$overlapping_geometry/elt[@id = $page/@id]/*"/>
   454     <xsl:variable name="page_overlapping_elements" select="//svg:*[@id = $page_overlapping_geometry/@Id]"/>
   465     <xsl:variable name="page_overlapping_elements" select="//svg:*[@id = $page_overlapping_geometry/@Id]"/>
   455     <xsl:variable name="page_sub_elements" select="func:refered_elements($page | $page_overlapping_elements)"/>
   466     <xsl:variable name="page_sub_elements" select="func:refered_elements($page | $page_overlapping_elements)"/>
   456     <func:result select="$page_sub_elements"/>
   467     <func:result select="$page_sub_elements"/>
   457   </func:function>
   468   </func:function>
   458   <func:function name="func:required_elements">
   469   <func:function name="func:required_elements">
   488   </func:function>
   499   </func:function>
   489   <xsl:variable name="_detachable_elements" select="func:detachable_elements($hmi_pages | $keypads)"/>
   500   <xsl:variable name="_detachable_elements" select="func:detachable_elements($hmi_pages | $keypads)"/>
   490   <xsl:variable name="detachable_elements" select="$_detachable_elements[not(ancestor::*/@id = $_detachable_elements/@id)]"/>
   501   <xsl:variable name="detachable_elements" select="$_detachable_elements[not(ancestor::*/@id = $_detachable_elements/@id)]"/>
   491   <declarations:detachable-elements/>
   502   <declarations:detachable-elements/>
   492   <xsl:template match="declarations:detachable-elements">
   503   <xsl:template match="declarations:detachable-elements">
   493     <xsl:variable name="_unused" select="ns:ProgressStart(name())"/>
       
   494     <xsl:text>
   504     <xsl:text>
   495 </xsl:text>
   505 </xsl:text>
   496     <xsl:text>/* </xsl:text>
   506     <xsl:text>/* </xsl:text>
   497     <xsl:value-of select="local-name()"/>
   507     <xsl:value-of select="local-name()"/>
   498     <xsl:text> */
   508     <xsl:text> */
   519     </xsl:for-each>
   529     </xsl:for-each>
   520     <xsl:text>}
   530     <xsl:text>}
   521 </xsl:text>
   531 </xsl:text>
   522     <xsl:text>
   532     <xsl:text>
   523 </xsl:text>
   533 </xsl:text>
   524     <xsl:variable name="__unused" select="ns:ProgressEnd(name())"/>
       
   525   </xsl:template>
   534   </xsl:template>
   526   <xsl:variable name="forEach_widgets_ids" select="$parsed_widgets/widget[@type = 'ForEach']/@id"/>
   535   <xsl:variable name="forEach_widgets_ids" select="$parsed_widgets/widget[@type = 'ForEach']/@id"/>
   527   <xsl:variable name="forEach_widgets" select="$hmi_widgets[@id = $forEach_widgets_ids]"/>
   536   <xsl:variable name="forEach_widgets" select="$hmi_widgets[@id = $forEach_widgets_ids]"/>
   528   <xsl:variable name="in_forEach_widget_ids" select="func:refered_elements($forEach_widgets)[not(@id = $forEach_widgets_ids)]/@id"/>
   537   <xsl:variable name="in_forEach_widget_ids" select="func:refered_elements($forEach_widgets)[not(@id = $forEach_widgets_ids)]/@id"/>
   529   <xsl:template mode="page_desc" match="svg:*">
   538   <xsl:template mode="page_desc" match="svg:*">
   533         <xsl:value-of select="@id"/>
   542         <xsl:value-of select="@id"/>
   534         <xsl:text> is nested in another HMI:Page</xsl:text>
   543         <xsl:text> is nested in another HMI:Page</xsl:text>
   535       </xsl:message>
   544       </xsl:message>
   536     </xsl:if>
   545     </xsl:if>
   537     <xsl:variable name="desc" select="func:widget(@id)"/>
   546     <xsl:variable name="desc" select="func:widget(@id)"/>
       
   547     <xsl:variable name="msg" select="concat('generating page description ', $desc/arg[1]/@value)"/>
       
   548     <xsl:value-of select="ns:ProgressStart($msg)"/>
   538     <xsl:variable name="page" select="."/>
   549     <xsl:variable name="page" select="."/>
   539     <xsl:variable name="p" select="$geometry[@Id = $page/@id]"/>
   550     <xsl:variable name="p" select="$geometry[@Id = $page/@id]"/>
   540     <xsl:variable name="page_all_elements" select="func:all_related_elements($page)"/>
   551     <xsl:variable name="page_all_elements" select="func:all_related_elements($page)"/>
   541     <xsl:variable name="all_page_widgets" select="$hmi_widgets[@id = $page_all_elements/@id and @id != $page/@id]"/>
   552     <xsl:variable name="all_page_widgets" select="$hmi_widgets[@id = $page_all_elements/@id and @id != $page/@id]"/>
   542     <xsl:variable name="page_managed_widgets" select="$all_page_widgets[not(@id=$in_forEach_widget_ids)]"/>
   553     <xsl:variable name="page_managed_widgets" select="$all_page_widgets[not(@id=$in_forEach_widget_ids)]"/>
   543     <xsl:variable name="page_relative_widgets" select="$page_managed_widgets[func:is_descendant_path(func:widget(@id)/path/@value, $desc/path/@value)]"/>
   554     <xsl:variable name="page_relative_widgets" select="$page_managed_widgets[func:is_descendant_path(func:widget(@id)/path/@value, $desc/path/@value)]"/>
   544     <xsl:variable name="required_detachables" select="func:sumarized_elements($page_all_elements)/&#10;           ancestor-or-self::*[@id = $detachable_elements/@id]"/>
   555     <xsl:variable name="sumarized_page" select="func:sumarized_elements($page_all_elements)"/>
       
   556     <xsl:variable name="required_detachables" select="$sumarized_page/&#10;           ancestor-or-self::*[@id = $detachable_elements/@id]"/>
   545     <xsl:text>  "</xsl:text>
   557     <xsl:text>  "</xsl:text>
   546     <xsl:value-of select="$desc/arg[1]/@value"/>
   558     <xsl:value-of select="$desc/arg[1]/@value"/>
   547     <xsl:text>": {
   559     <xsl:text>": {
   548 </xsl:text>
   560 </xsl:text>
   549     <xsl:text>    bbox: [</xsl:text>
   561     <xsl:text>    bbox: [</xsl:text>
   632     <xsl:if test="position()!=last()">
   644     <xsl:if test="position()!=last()">
   633       <xsl:text>,</xsl:text>
   645       <xsl:text>,</xsl:text>
   634     </xsl:if>
   646     </xsl:if>
   635     <xsl:text>
   647     <xsl:text>
   636 </xsl:text>
   648 </xsl:text>
       
   649     <xsl:value-of select="ns:ProgressEnd($msg)"/>
   637   </xsl:template>
   650   </xsl:template>
   638   <definitions:page-desc/>
   651   <definitions:page-desc/>
   639   <xsl:template match="definitions:page-desc">
   652   <xsl:template match="definitions:page-desc">
   640     <xsl:variable name="_unused" select="ns:ProgressStart(name())"/>
       
   641     <xsl:text>
   653     <xsl:text>
   642 </xsl:text>
   654 </xsl:text>
   643     <xsl:text>/* </xsl:text>
   655     <xsl:text>/* </xsl:text>
   644     <xsl:value-of select="local-name()"/>
   656     <xsl:value-of select="local-name()"/>
   645     <xsl:text> */
   657     <xsl:text> */
   653     <xsl:apply-templates mode="page_desc" select="$hmi_pages"/>
   665     <xsl:apply-templates mode="page_desc" select="$hmi_pages"/>
   654     <xsl:text>}
   666     <xsl:text>}
   655 </xsl:text>
   667 </xsl:text>
   656     <xsl:text>
   668     <xsl:text>
   657 </xsl:text>
   669 </xsl:text>
   658     <xsl:variable name="__unused" select="ns:ProgressEnd(name())"/>
       
   659   </xsl:template>
   670   </xsl:template>
   660   <xsl:template mode="per_page_widget_template" match="*"/>
   671   <xsl:template mode="per_page_widget_template" match="*"/>
   661   <debug:detachable-pages/>
   672   <debug:detachable-pages/>
   662   <xsl:template match="debug:detachable-pages">
   673   <xsl:template match="debug:detachable-pages">
   663     <xsl:variable name="_unused" select="ns:ProgressStart(name())"/>
       
   664     <xsl:text>
   674     <xsl:text>
   665 </xsl:text>
   675 </xsl:text>
   666     <xsl:text>/* </xsl:text>
   676     <xsl:text>/* </xsl:text>
   667     <xsl:value-of select="local-name()"/>
   677     <xsl:value-of select="local-name()"/>
   668     <xsl:text> */
   678     <xsl:text> */
   685       <xsl:text> </xsl:text>
   695       <xsl:text> </xsl:text>
   686       <xsl:value-of select="."/>
   696       <xsl:value-of select="."/>
   687       <xsl:text>
   697       <xsl:text>
   688 </xsl:text>
   698 </xsl:text>
   689     </xsl:for-each>
   699     </xsl:for-each>
   690     <xsl:text>
   700     <xsl:text>Overlapping 
   691 </xsl:text>
   701 </xsl:text>
   692     <xsl:variable name="__unused" select="ns:ProgressEnd(name())"/>
   702     <xsl:apply-templates mode="testtree" select="$overlapping_geometry"/>
       
   703     <xsl:text>
       
   704 </xsl:text>
   693   </xsl:template>
   705   </xsl:template>
   694   <xsl:template xmlns="http://www.w3.org/2000/svg" mode="inline_svg" match="@*">
   706   <xsl:template xmlns="http://www.w3.org/2000/svg" mode="inline_svg" match="@*">
   695     <xsl:copy/>
   707     <xsl:copy/>
   696   </xsl:template>
   708   </xsl:template>
   697   <xsl:template mode="inline_svg" match="node()">
   709   <xsl:template mode="inline_svg" match="node()">
   907     <xsl:apply-templates mode="inline_svg" select="/"/>
   919     <xsl:apply-templates mode="inline_svg" select="/"/>
   908   </xsl:variable>
   920   </xsl:variable>
   909   <xsl:variable name="result_svg_ns" select="exsl:node-set($result_svg)"/>
   921   <xsl:variable name="result_svg_ns" select="exsl:node-set($result_svg)"/>
   910   <preamble:inline-svg/>
   922   <preamble:inline-svg/>
   911   <xsl:template match="preamble:inline-svg">
   923   <xsl:template match="preamble:inline-svg">
   912     <xsl:variable name="_unused" select="ns:ProgressStart(name())"/>
       
   913     <xsl:text>
   924     <xsl:text>
   914 </xsl:text>
   925 </xsl:text>
   915     <xsl:text>/* </xsl:text>
   926     <xsl:text>/* </xsl:text>
   916     <xsl:value-of select="local-name()"/>
   927     <xsl:value-of select="local-name()"/>
   917     <xsl:text> */
   928     <xsl:text> */
   924     <xsl:value-of select="$svg/@id"/>
   935     <xsl:value-of select="$svg/@id"/>
   925     <xsl:text>");
   936     <xsl:text>");
   926 </xsl:text>
   937 </xsl:text>
   927     <xsl:text>
   938     <xsl:text>
   928 </xsl:text>
   939 </xsl:text>
   929     <xsl:variable name="__unused" select="ns:ProgressEnd(name())"/>
       
   930   </xsl:template>
   940   </xsl:template>
   931   <debug:clone-unlinking/>
   941   <debug:clone-unlinking/>
   932   <xsl:template match="debug:clone-unlinking">
   942   <xsl:template match="debug:clone-unlinking">
   933     <xsl:variable name="_unused" select="ns:ProgressStart(name())"/>
       
   934     <xsl:text>
   943     <xsl:text>
   935 </xsl:text>
   944 </xsl:text>
   936     <xsl:text>/* </xsl:text>
   945     <xsl:text>/* </xsl:text>
   937     <xsl:value-of select="local-name()"/>
   946     <xsl:value-of select="local-name()"/>
   938     <xsl:text> */
   947     <xsl:text> */
   955       <xsl:text>
   964       <xsl:text>
   956 </xsl:text>
   965 </xsl:text>
   957     </xsl:for-each>
   966     </xsl:for-each>
   958     <xsl:text>
   967     <xsl:text>
   959 </xsl:text>
   968 </xsl:text>
   960     <xsl:variable name="__unused" select="ns:ProgressEnd(name())"/>
       
   961   </xsl:template>
   969   </xsl:template>
   962   <xsl:template mode="extract_i18n" match="svg:tspan">
   970   <xsl:template mode="extract_i18n" match="svg:tspan">
   963     <xsl:if test="string-length(.) &gt; 0">
   971     <xsl:if test="string-length(.) &gt; 0">
   964       <line>
   972       <line>
   965         <xsl:value-of select="."/>
   973         <xsl:value-of select="."/>
   981   <xsl:variable name="translatable_strings">
   989   <xsl:variable name="translatable_strings">
   982     <xsl:apply-templates mode="extract_i18n" select="$translatable_texts"/>
   990     <xsl:apply-templates mode="extract_i18n" select="$translatable_texts"/>
   983   </xsl:variable>
   991   </xsl:variable>
   984   <preamble:i18n/>
   992   <preamble:i18n/>
   985   <xsl:template match="preamble:i18n">
   993   <xsl:template match="preamble:i18n">
   986     <xsl:variable name="_unused" select="ns:ProgressStart(name())"/>
       
   987     <xsl:text>
   994     <xsl:text>
   988 </xsl:text>
   995 </xsl:text>
   989     <xsl:text>/* </xsl:text>
   996     <xsl:text>/* </xsl:text>
   990     <xsl:value-of select="local-name()"/>
   997     <xsl:value-of select="local-name()"/>
   991     <xsl:text> */
   998     <xsl:text> */
  1044     </xsl:for-each>
  1051     </xsl:for-each>
  1045     <xsl:text>]
  1052     <xsl:text>]
  1046 </xsl:text>
  1053 </xsl:text>
  1047     <xsl:text>
  1054     <xsl:text>
  1048 </xsl:text>
  1055 </xsl:text>
  1049     <xsl:variable name="__unused" select="ns:ProgressEnd(name())"/>
       
  1050   </xsl:template>
  1056   </xsl:template>
  1051   <xsl:template mode="hmi_widgets" match="svg:*">
  1057   <xsl:template mode="hmi_widgets" match="svg:*">
  1052     <xsl:variable name="widget" select="func:widget(@id)"/>
  1058     <xsl:variable name="widget" select="func:widget(@id)"/>
  1053     <xsl:variable name="eltid" select="@id"/>
  1059     <xsl:variable name="eltid" select="@id"/>
  1054     <xsl:variable name="args">
  1060     <xsl:variable name="args">
  1147     <xsl:text>
  1153     <xsl:text>
  1148 </xsl:text>
  1154 </xsl:text>
  1149   </xsl:template>
  1155   </xsl:template>
  1150   <preamble:local-variable-indexes/>
  1156   <preamble:local-variable-indexes/>
  1151   <xsl:template match="preamble:local-variable-indexes">
  1157   <xsl:template match="preamble:local-variable-indexes">
  1152     <xsl:variable name="_unused" select="ns:ProgressStart(name())"/>
       
  1153     <xsl:text>
  1158     <xsl:text>
  1154 </xsl:text>
  1159 </xsl:text>
  1155     <xsl:text>/* </xsl:text>
  1160     <xsl:text>/* </xsl:text>
  1156     <xsl:value-of select="local-name()"/>
  1161     <xsl:value-of select="local-name()"/>
  1157     <xsl:text> */
  1162     <xsl:text> */
  1291 </xsl:text>
  1296 </xsl:text>
  1292     <xsl:text>}
  1297     <xsl:text>}
  1293 </xsl:text>
  1298 </xsl:text>
  1294     <xsl:text>
  1299     <xsl:text>
  1295 </xsl:text>
  1300 </xsl:text>
  1296     <xsl:variable name="__unused" select="ns:ProgressEnd(name())"/>
       
  1297   </xsl:template>
  1301   </xsl:template>
  1298   <preamble:widget-base-class/>
  1302   <preamble:widget-base-class/>
  1299   <xsl:template match="preamble:widget-base-class">
  1303   <xsl:template match="preamble:widget-base-class">
  1300     <xsl:variable name="_unused" select="ns:ProgressStart(name())"/>
       
  1301     <xsl:text>
  1304     <xsl:text>
  1302 </xsl:text>
  1305 </xsl:text>
  1303     <xsl:text>/* </xsl:text>
  1306     <xsl:text>/* </xsl:text>
  1304     <xsl:value-of select="local-name()"/>
  1307     <xsl:value-of select="local-name()"/>
  1305     <xsl:text> */
  1308     <xsl:text> */
  1690 </xsl:text>
  1693 </xsl:text>
  1691     <xsl:text>}
  1694     <xsl:text>}
  1692 </xsl:text>
  1695 </xsl:text>
  1693     <xsl:text>
  1696     <xsl:text>
  1694 </xsl:text>
  1697 </xsl:text>
  1695     <xsl:variable name="__unused" select="ns:ProgressEnd(name())"/>
       
  1696   </xsl:template>
  1698   </xsl:template>
  1697   <xsl:variable name="excluded_types" select="str:split('Page VarInit VarInitPersistent')"/>
  1699   <xsl:variable name="excluded_types" select="str:split('Page VarInit VarInitPersistent')"/>
  1698   <xsl:key name="TypesKey" match="widget" use="@type"/>
  1700   <xsl:key name="TypesKey" match="widget" use="@type"/>
  1699   <declarations:hmi-classes/>
  1701   <declarations:hmi-classes/>
  1700   <xsl:template match="declarations:hmi-classes">
  1702   <xsl:template match="declarations:hmi-classes">
  1701     <xsl:variable name="_unused" select="ns:ProgressStart(name())"/>
       
  1702     <xsl:text>
  1703     <xsl:text>
  1703 </xsl:text>
  1704 </xsl:text>
  1704     <xsl:text>/* </xsl:text>
  1705     <xsl:text>/* </xsl:text>
  1705     <xsl:value-of select="local-name()"/>
  1706     <xsl:value-of select="local-name()"/>
  1706     <xsl:text> */
  1707     <xsl:text> */
  1709 </xsl:text>
  1710 </xsl:text>
  1710     <xsl:variable name="used_widget_types" select="$parsed_widgets/widget[&#10;                                    generate-id() = generate-id(key('TypesKey', @type)) and &#10;                                    not(@type = $excluded_types)]"/>
  1711     <xsl:variable name="used_widget_types" select="$parsed_widgets/widget[&#10;                                    generate-id() = generate-id(key('TypesKey', @type)) and &#10;                                    not(@type = $excluded_types)]"/>
  1711     <xsl:apply-templates mode="widget_class" select="$used_widget_types"/>
  1712     <xsl:apply-templates mode="widget_class" select="$used_widget_types"/>
  1712     <xsl:text>
  1713     <xsl:text>
  1713 </xsl:text>
  1714 </xsl:text>
  1714     <xsl:variable name="__unused" select="ns:ProgressEnd(name())"/>
       
  1715   </xsl:template>
  1715   </xsl:template>
  1716   <xsl:template mode="widget_class" match="widget">
  1716   <xsl:template mode="widget_class" match="widget">
  1717     <xsl:text>class </xsl:text>
  1717     <xsl:text>class </xsl:text>
  1718     <xsl:value-of select="@type"/>
  1718     <xsl:value-of select="@type"/>
  1719     <xsl:text>Widget extends Widget{
  1719     <xsl:text>Widget extends Widget{
  1725     <xsl:text>}
  1725     <xsl:text>}
  1726 </xsl:text>
  1726 </xsl:text>
  1727   </xsl:template>
  1727   </xsl:template>
  1728   <xsl:variable name="included_ids" select="$parsed_widgets/widget[not(@type = $excluded_types) and not(@id = $discardable_elements/@id)]/@id"/>
  1728   <xsl:variable name="included_ids" select="$parsed_widgets/widget[not(@type = $excluded_types) and not(@id = $discardable_elements/@id)]/@id"/>
  1729   <xsl:variable name="hmi_widgets" select="$hmi_elements[@id = $included_ids]"/>
  1729   <xsl:variable name="hmi_widgets" select="$hmi_elements[@id = $included_ids]"/>
       
  1730   <xsl:variable name="result_widgets" select="$result_svg_ns//*[@id = $hmi_widgets/@id]"/>
  1730   <declarations:hmi-elements/>
  1731   <declarations:hmi-elements/>
  1731   <xsl:template match="declarations:hmi-elements">
  1732   <xsl:template match="declarations:hmi-elements">
  1732     <xsl:variable name="_unused" select="ns:ProgressStart(name())"/>
       
  1733     <xsl:text>
  1733     <xsl:text>
  1734 </xsl:text>
  1734 </xsl:text>
  1735     <xsl:text>/* </xsl:text>
  1735     <xsl:text>/* </xsl:text>
  1736     <xsl:value-of select="local-name()"/>
  1736     <xsl:value-of select="local-name()"/>
  1737     <xsl:text> */
  1737     <xsl:text> */
  1743     <xsl:apply-templates mode="hmi_widgets" select="$hmi_widgets"/>
  1743     <xsl:apply-templates mode="hmi_widgets" select="$hmi_widgets"/>
  1744     <xsl:text>}
  1744     <xsl:text>}
  1745 </xsl:text>
  1745 </xsl:text>
  1746     <xsl:text>
  1746     <xsl:text>
  1747 </xsl:text>
  1747 </xsl:text>
  1748     <xsl:variable name="__unused" select="ns:ProgressEnd(name())"/>
       
  1749   </xsl:template>
  1748   </xsl:template>
  1750   <xsl:template name="defs_by_labels">
  1749   <xsl:template name="defs_by_labels">
  1751     <xsl:param name="labels" select="''"/>
  1750     <xsl:param name="labels" select="''"/>
  1752     <xsl:param name="mandatory" select="'yes'"/>
  1751     <xsl:param name="mandatory" select="'yes'"/>
  1753     <xsl:param name="subelements" select="/.."/>
  1752     <xsl:param name="subelements" select="/.."/>
  1754     <xsl:param name="hmi_element"/>
  1753     <xsl:param name="hmi_element"/>
  1755     <xsl:variable name="widget_type" select="@type"/>
  1754     <xsl:variable name="widget_type" select="@type"/>
  1756     <xsl:for-each select="str:split($labels)">
  1755     <xsl:for-each select="str:split($labels)">
  1757       <xsl:variable name="name" select="."/>
  1756       <xsl:variable name="name" select="."/>
  1758       <xsl:variable name="elt" select="$result_svg_ns//*[@id = $hmi_element/@id]//*[@inkscape:label=$name][1]"/>
  1757       <xsl:variable name="elt" select="$result_widgets[@id = $hmi_element/@id]//*[@inkscape:label=$name][1]"/>
  1759       <xsl:choose>
  1758       <xsl:choose>
  1760         <xsl:when test="not($elt/@id)">
  1759         <xsl:when test="not($elt/@id)">
  1761           <xsl:if test="$mandatory='yes'">
  1760           <xsl:if test="$mandatory='yes'">
  1762             <xsl:message terminate="yes">
  1761             <xsl:message terminate="yes">
  1763               <xsl:value-of select="$widget_type"/>
  1762               <xsl:value-of select="$widget_type"/>
  2993 </xsl:text>
  2992 </xsl:text>
  2994     </xsl:if>
  2993     </xsl:if>
  2995   </xsl:template>
  2994   </xsl:template>
  2996   <preamble:display/>
  2995   <preamble:display/>
  2997   <xsl:template match="preamble:display">
  2996   <xsl:template match="preamble:display">
  2998     <xsl:variable name="_unused" select="ns:ProgressStart(name())"/>
       
  2999     <xsl:text>
  2997     <xsl:text>
  3000 </xsl:text>
  2998 </xsl:text>
  3001     <xsl:text>/* </xsl:text>
  2999     <xsl:text>/* </xsl:text>
  3002     <xsl:value-of select="local-name()"/>
  3000     <xsl:value-of select="local-name()"/>
  3003     <xsl:text> */
  3001     <xsl:text> */
  3470 </xsl:text>
  3468 </xsl:text>
  3471     <xsl:text>}(); // eslint-disable-line    
  3469     <xsl:text>}(); // eslint-disable-line    
  3472 </xsl:text>
  3470 </xsl:text>
  3473     <xsl:text>
  3471     <xsl:text>
  3474 </xsl:text>
  3472 </xsl:text>
  3475     <xsl:variable name="__unused" select="ns:ProgressEnd(name())"/>
       
  3476   </xsl:template>
  3473   </xsl:template>
  3477   <xsl:template mode="widget_class" match="widget[@type='DropDown']">
  3474   <xsl:template mode="widget_class" match="widget[@type='DropDown']">
  3478     <xsl:text>    function numb_event(e) {
  3475     <xsl:text>    function numb_event(e) {
  3479 </xsl:text>
  3476 </xsl:text>
  3480     <xsl:text>        e.stopPropagation();
  3477     <xsl:text>        e.stopPropagation();
  5181       </xsl:if>
  5178       </xsl:if>
  5182     </xsl:if>
  5179     </xsl:if>
  5183   </xsl:template>
  5180   </xsl:template>
  5184   <declarations:jump/>
  5181   <declarations:jump/>
  5185   <xsl:template match="declarations:jump">
  5182   <xsl:template match="declarations:jump">
  5186     <xsl:variable name="_unused" select="ns:ProgressStart(name())"/>
       
  5187     <xsl:text>
  5183     <xsl:text>
  5188 </xsl:text>
  5184 </xsl:text>
  5189     <xsl:text>/* </xsl:text>
  5185     <xsl:text>/* </xsl:text>
  5190     <xsl:value-of select="local-name()"/>
  5186     <xsl:value-of select="local-name()"/>
  5191     <xsl:text> */
  5187     <xsl:text> */
  5208 </xsl:text>
  5204 </xsl:text>
  5209     <xsl:text>
  5205     <xsl:text>
  5210 </xsl:text>
  5206 </xsl:text>
  5211     <xsl:text>
  5207     <xsl:text>
  5212 </xsl:text>
  5208 </xsl:text>
  5213     <xsl:variable name="__unused" select="ns:ProgressEnd(name())"/>
       
  5214   </xsl:template>
  5209   </xsl:template>
  5215   <declarations:keypad/>
  5210   <declarations:keypad/>
  5216   <xsl:template match="declarations:keypad">
  5211   <xsl:template match="declarations:keypad">
  5217     <xsl:variable name="_unused" select="ns:ProgressStart(name())"/>
       
  5218     <xsl:text>
  5212     <xsl:text>
  5219 </xsl:text>
  5213 </xsl:text>
  5220     <xsl:text>/* </xsl:text>
  5214     <xsl:text>/* </xsl:text>
  5221     <xsl:value-of select="local-name()"/>
  5215     <xsl:value-of select="local-name()"/>
  5222     <xsl:text> */
  5216     <xsl:text> */
  5245     </xsl:for-each>
  5239     </xsl:for-each>
  5246     <xsl:text>}
  5240     <xsl:text>}
  5247 </xsl:text>
  5241 </xsl:text>
  5248     <xsl:text>
  5242     <xsl:text>
  5249 </xsl:text>
  5243 </xsl:text>
  5250     <xsl:variable name="__unused" select="ns:ProgressEnd(name())"/>
       
  5251   </xsl:template>
  5244   </xsl:template>
  5252   <xsl:template mode="widget_class" match="widget[@type='Keypad']">
  5245   <xsl:template mode="widget_class" match="widget[@type='Keypad']">
  5253     <xsl:text>class KeypadWidget extends Widget{
  5246     <xsl:text>class KeypadWidget extends Widget{
  5254 </xsl:text>
  5247 </xsl:text>
  5255     <xsl:text>
  5248     <xsl:text>