Quote:
|
quote:Alright, here we go:
|
the only thing you needed to amend in the stylesheet provided for you by Alain is to add a check whether this is a first pagebreak processed, and if yes - add there one more <div> with all the preceding elements, e.g. using <xsl:if>:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="div">
<div class="article-content-container">
<xsl:for-each select="pagebreak">
<xsl:if test="position()=1">
<div class="page-content-container">
<xsl:copy-of select="preceding-sibling::*"/>
</div>
</xsl:if>
<xsl:copy-of select="."/>
<xsl:variable name="nbpg" select="position()"/>
<div class="page-content-container">
<xsl:copy-of select="following-sibling::*[name()!='pagebreak' and count(preceding-sibling::pagebreak)=$nbpg]"/>
</div>
</xsl:for-each>
</div>
</xsl:template>
</xsl:stylesheet>