--- a/svghmi/detachable_pages.ysl2 Wed Mar 20 16:44:29 2024 +0100
+++ b/svghmi/detachable_pages.ysl2 Tue Mar 26 17:08:45 2024 +0100
@@ -78,7 +78,8 @@
def "func:all_related_elements" {
param "page";
const "page_overlapping_geometry", "$overlapping_geometry/elt[@id = $page/@id]/*";
- const "page_overlapping_elements", "//svg:*[@id = $page_overlapping_geometry/@Id]";
+ const "overlapping_candidates", "//svg:*[not(starts-with((ancestor::svg:g | .) /@inkscape:label, 'DISCARD:'))]";
+ const "page_overlapping_elements", "$overlapping_candidates[@id = $page_overlapping_geometry/@Id]";
const "page_widgets_elements", """
$hmi_elements[not(@id=$page/@id)
and descendant-or-self::svg:*/@id = $page_overlapping_elements/@id]
--- a/svghmi/gen_index_xhtml.xslt Wed Mar 20 16:44:29 2024 +0100
+++ b/svghmi/gen_index_xhtml.xslt Tue Mar 26 17:08:45 2024 +0100
@@ -694,7 +694,8 @@
<func:function name="func:all_related_elements">
<xsl:param name="page"/>
<xsl:variable name="page_overlapping_geometry" select="$overlapping_geometry/elt[@id = $page/@id]/*"/>
- <xsl:variable name="page_overlapping_elements" select="//svg:*[@id = $page_overlapping_geometry/@Id]"/>
+ <xsl:variable name="overlapping_candidates" select="//svg:*[not(starts-with((ancestor::svg:g | .) /@inkscape:label, 'DISCARD:'))]"/>
+ <xsl:variable name="page_overlapping_elements" select="$overlapping_candidates[@id = $page_overlapping_geometry/@Id]"/>
<xsl:variable name="page_widgets_elements" select=" $hmi_elements[not(@id=$page/@id) and descendant-or-self::svg:*/@id = $page_overlapping_elements/@id] /descendant-or-self::svg:*"/>
<xsl:variable name="page_sub_elements" select="func:refered_elements($page | $page_overlapping_elements | $page_widgets_elements)"/>
<func:result select="$page_sub_elements"/>