svghmi/gen_index_xhtml.xslt
branchsvghmi
changeset 2888 7beddc62a388
parent 2887 30cea13267b4
child 2889 4eeed820fd3a
equal deleted inserted replaced
2887:30cea13267b4 2888:7beddc62a388
   321   <func:function name="func:is_descendant_path">
   321   <func:function name="func:is_descendant_path">
   322     <xsl:param name="descend"/>
   322     <xsl:param name="descend"/>
   323     <xsl:param name="ancest"/>
   323     <xsl:param name="ancest"/>
   324     <func:result select="string-length($ancest) &gt; 0 and starts-with($descend,$ancest)"/>
   324     <func:result select="string-length($ancest) &gt; 0 and starts-with($descend,$ancest)"/>
   325   </func:function>
   325   </func:function>
       
   326   <xsl:variable name="forEach_widgets_ids" select="$parsed_widgets/widget[@type = 'ForEach']/@id"/>
       
   327   <xsl:variable name="forEach_widgets" select="$hmi_elements[@id = $forEach_widgets_ids]"/>
       
   328   <xsl:variable name="in_forEach_widget_ids" select="func:refered_elements($forEach_widgets)[not(@id = $forEach_widgets_ids)]/@id"/>
   326   <xsl:template mode="page_desc" match="svg:*">
   329   <xsl:template mode="page_desc" match="svg:*">
   327     <xsl:variable name="desc" select="func:widget(@id)"/>
   330     <xsl:variable name="desc" select="func:widget(@id)"/>
   328     <xsl:variable name="page" select="."/>
   331     <xsl:variable name="page" select="."/>
   329     <xsl:variable name="p" select="$geometry[@Id = $page/@id]"/>
   332     <xsl:variable name="p" select="$geometry[@Id = $page/@id]"/>
   330     <xsl:variable name="page_all_elements" select="func:all_related_elements($page)"/>
   333     <xsl:variable name="page_all_elements" select="func:all_related_elements($page)"/>
   331     <xsl:variable name="all_page_widgets" select="$hmi_elements[@id = $page_all_elements/@id and @id != $page/@id]"/>
   334     <xsl:variable name="all_page_widgets" select="$hmi_elements[@id = $page_all_elements/@id and @id != $page/@id and not(@id=$in_forEach_widget_ids)]"/>
   332     <xsl:variable name="page_relative_widgets" select="$all_page_widgets[func:is_descendant_path(func:widget(@id)/path/@value, $desc/path/@value)]"/>
   335     <xsl:variable name="page_relative_widgets" select="$all_page_widgets[func:is_descendant_path(func:widget(@id)/path/@value, $desc/path/@value)]"/>
   333     <xsl:variable name="required_detachables" select="func:sumarized_elements($page_all_elements)/&#10;           ancestor-or-self::*[@id = $detachable_elements/@id]"/>
   336     <xsl:variable name="required_detachables" select="func:sumarized_elements($page_all_elements)/&#10;           ancestor-or-self::*[@id = $detachable_elements/@id]"/>
   334     <xsl:text>  "</xsl:text>
   337     <xsl:text>  "</xsl:text>
   335     <xsl:value-of select="$desc/arg[1]/@value"/>
   338     <xsl:value-of select="$desc/arg[1]/@value"/>
   336     <xsl:text>": {
   339     <xsl:text>": {
   414     </xsl:if>
   417     </xsl:if>
   415     <xsl:text>
   418     <xsl:text>
   416 </xsl:text>
   419 </xsl:text>
   417   </xsl:template>
   420   </xsl:template>
   418   <xsl:template name="debug_detachables">
   421   <xsl:template name="debug_detachables">
       
   422     <xsl:text>DETACHABLES:
       
   423 </xsl:text>
   419     <xsl:for-each select="$detachable_elements">
   424     <xsl:for-each select="$detachable_elements">
   420       <xsl:text> </xsl:text>
   425       <xsl:text> </xsl:text>
   421       <xsl:value-of select="@id"/>
   426       <xsl:value-of select="@id"/>
       
   427       <xsl:text>
       
   428 </xsl:text>
       
   429     </xsl:for-each>
       
   430     <xsl:text>In Foreach:
       
   431 </xsl:text>
       
   432     <xsl:for-each select="$in_forEach_widget_ids">
       
   433       <xsl:text> </xsl:text>
       
   434       <xsl:value-of select="."/>
   422       <xsl:text>
   435       <xsl:text>
   423 </xsl:text>
   436 </xsl:text>
   424     </xsl:for-each>
   437     </xsl:for-each>
   425   </xsl:template>
   438   </xsl:template>
   426   <xsl:template mode="inline_svg" match="@* | node()">
   439   <xsl:template mode="inline_svg" match="@* | node()">