Dnia Sun, 2 Nov 2014 19:03:10 +0100, Borys Pogoreło napisał(a):
> Póki co (chyba) udało mi się uzyskać ten efekt następującym łamańcem, ale
> czy da się to zrobić jakoś prościej?
... i sam sobie odpowiem: da się. I po co ja tak kombinowałem.
Dla potomnych:
<xsl:template match="object[@template = 'a']">
<xsl:if test="position() = 1 or preceding-sibling::object[1]/@template !=
'a'">
<wrapper>
<xsl:apply-templates select="." mode="content"/>
</wrapper>
</xsl:if>
</xsl:template>
<xsl:template match="object[@template = 'a']" mode="content">
<xsl:variable name="next" select="following-sibling::object[@template =
'a' and position() = 1]"/>
<!-- formatowanie -->
<xsl:if test="$next">
<xsl:apply-templates select="$next" mode="content"/>
</xsl:if>