<body> <!-- main body for main book flow -->
<xsl:if test="autor_utworu or nazwa_utworu">
<title>
- <xsl:apply-templates mode="para"
+ <xsl:apply-templates mode="title"
select="autor_utworu|nazwa_utworu"/>
</title>
</xsl:if>
+ <xsl:variable name="sections" select="count(naglowek_rozdzial)"/>
+ <section>
+ <xsl:apply-templates mode="para"
+ select="*[count(following-sibling::naglowek_rozdzial)
+ = $sections]"/>
+ </section>
+
<xsl:apply-templates mode="sections"/>
</body>
</xsl:template>
+
+ <xsl:template mode="title" match="autor_utworu|nazwa_utworu">
+ <!-- title -->
+
+ <p><xsl:apply-templates mode="inline"/></p>
+ </xsl:template>
</xsl:stylesheet>
<!-- in paragraph mode -->
- <xsl:template mode="para" match="autor_utworu|nazwa_utworu|akap|akap_dialog">
+ <xsl:template mode="para" match="akap|akap_dialog">
<!-- paragraphs & similar -->
<p><xsl:apply-templates mode="inline"/></p>
</xsl:template>
- <!-- in global scope -->
-
- <xsl:template mode="sections" match="akap|akap_dialog">
- <!-- paragraphs & similar -->
-
- <p><xsl:apply-templates mode="inline"/></p>
- </xsl:template>
- <xsl:template mode="sections" match="autor_utworu|nazwa_utworu"/>
+ <xsl:template mode="para" match="*"/>
+ <xsl:template mode="sections" match="*"/>
</xsl:stylesheet>