[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XSLT splitting (grouping?) hierarchical structure
Am 10.02.2022 um 09:54 schrieb Martin Honnen martin.honnen@xxxxxx:
https://archive.xmlprague.cz/2019/files/xmlprague-2019-proceedings.pdf#page=3 47
https://subversion.le-tex.de/common/presentations/2019-02-09_xmlprague_xslt-u pward-projection/slides/index.html
So somehow like this: B <xsl:mode name="split" on-no-match="shallow-copy"/> B <xsl:template match="node()" mode="split"> B B B <xsl:param name="nodes" tunnel="yes"/> B B B <xsl:if test=". intersect $nodes/ancestor-or-self::node()"> B B B B B <xsl:next-match/> B B B </xsl:if> B </xsl:template> B <xsl:template match="section"> B B B <xsl:variable name="section" select="."/> B B B <xsl:for-each-group select=".//node()" group-ending-with="split"> B B B B B <section> B B B B B B B <xsl:apply-templates select="$section/node()" mode="split"> B B B B B B B B B <xsl:with-param name="nodes" select="current-group()[not(self::split)] | $section/title/descendant-or-self::node()" tunnel="yes"/> B B B B B B B </xsl:apply-templates> B B B B B </section> B B B B B <xsl:copy-of select="current-group()[last()][self::split]"/> B B B </xsl:for-each-group> B </xsl:template>
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|