bdelacretaz 2003/09/27 11:45:04
Modified: src/blocks/slop/samples/yapt/stylesheets
filter-slop-output.xsl
Log:
Slide grouping bug corrected
Revision Changes Path
1.2 +9 -6
cocoon-2.1/src/blocks/slop/samples/yapt/stylesheets/filter-slop-output.xsl
Index: filter-slop-output.xsl
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/blocks/slop/samples/yapt/stylesheets/filter-slop-output.xsl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- filter-slop-output.xsl 26 Sep 2003 14:42:36 -0000 1.1
+++ filter-slop-output.xsl 27 Sep 2003 18:45:04 -0000 1.2
@@ -13,6 +13,12 @@
<!-- prefix for presentation hints in slides -->
<xsl:variable name="hintPrefix" select="'hint-'"/>
+ <!-- key based on last preceding slide element, used to group slides
content -->
+ <xsl:key
+ name="lastSlideKey"
+ match="slop:empty-line[not(self::slop:slide)]"
use="generate-id(preceding::slop:slide[1])"
+ />
+
<!--
Extract the presentation heading and let slides extract themselves,
once to generate the navigation (list of slides) and once to
@@ -79,11 +85,8 @@
<xsl:apply-templates mode="hints"
select="following-sibling::slop:*[starts-with(name(),$hintPrefix)][preceding::slop:slide[1]
= $anchor]"/>
</slide-hints>
<slide-content>
- <!-- recursively group paragraphs of this slide, separated
by empty lines -->
- <!-- TODO can be made more efficient using keys -->
- <xsl:for-each
select="following-sibling::slop:empty-line[preceding::slop:slide[1] = $anchor]">
- <xsl:apply-templates select="." mode="paragraph"/>
- </xsl:for-each>
+ <!-- get content of this slide based on lastSlideKey -->
+ <xsl:apply-templates
select="key('lastSlideKey',generate-id(.))" mode="paragraph"/>
</slide-content>
</slide>
</xsl:template>