|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Question about Page-Masters
Lehming, Thea wrote:
Again, thank you for your reply, but this doesn't seem to quite answer the query I had (perhaps it was not stated properly - I am a newbie to this and am still working on communicating exactly what it is I need to have happen). We know the idea of using an additional page-master, though *how do you get that to happen in a repeatable fashion*? Please see below:
There is no need to map whatever hierarchi in your source document into a block hierarchy in FO. It all ends up as text in some blocks. Getting the above as a result from an XSLT may be a bit unintuitive but it is certainly possible, for example if your source is <chapter> <title>Chapter 1</title> <section> <title>Section 1</title> ... </section> ... then something like the following could be used: <xsl:template match="chapter"> <xsl:apply-templates select="section[1]"> <xsl:with-param name="additional-stuff" select="title"/> </xsl:apply-templates> <xsl:apply-templates select="section[position() > 1]"> </xsl:template> <xsl:template match="section">
<xsl:param name="additional-stuff"/>
<fo:page-sequence>
<xsl:choose>
<xsl:when test="position()=last()">
<xsl:attribute name="master-reference">
<xsl:text>one-column<xsl:text>
</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="master-reference">
<xsl:text>two-column<xsl:text>
</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<fo:flow>
<xsl:apply-templates select="$additional-stuff"/>
<xsl:apply-templates/>
</fo:flow>
</fo:page-sequence>
</xsl:template>J.Pietschmann XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|






