[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Question about Page-Masters

Subject: Re: Question about Page-Masters
From: "J.Pietschmann" <j3322ptm@xxxxxxxx>
Date: Thu, 28 Aug 2003 22:04:15 +0200
fo page sequence master reference
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:

I'm not sure what your problem has to do with repeating. I'd think the goal is to create a FO document roughly like <fo:root ... > <fo:layout-master-set> <fo:simple-page-master name="one-column"> ... </fo:simple-page-master> <fo:simple-page-master name="two-column"> ... </fo:simple-page-master> <fo:layout-master-set> <fo:page-sequence master-reference="two-column"> <fo:flow ...> <fo:block>Chapter 1<fo:block> <fo:block>Section 1<fo:block> ... <fo:flow> <fo:page-sequence> <fo:page-sequence master-reference="two-column"> <fo:flow ...> <fo:block>Section 2<fo:block> ... <fo:flow> <fo:page-sequence> ... <fo:page-sequence master-reference="one-column"> <fo:flow ...> <fo:block>Section 5<fo:block> ... <fo:flow> <fo:page-sequence>

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() &gt; 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



Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.