This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Need help with page sequencing


Hello All!

I have to two simple page masters, landscape and master-pages-for-all.

I want the landscape page master to be selected if <landscape> node is a
child of <page>.

<page>
   <landscape />
   --  -- -
</page>

But all the pages flow inside the master-pages-for-all.

I've tried to make this work in a lot of different ways(with my limited
Formatting object knowledge) but with no result.

Can someone, please look at my files and see what is it that I am doing
wrong.

Thank you.

Here is part of the XSL..

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:fo="http://www.w3.org/1999/XSL/Format">

<xsl:template match="/">
  <xsl:apply-templates select="book"/>
</xsl:template>
<xsl:template match="book">
<xsl:processing-instruction
      name="cocoon-format">type="text/xslfo"</xsl:processing-instruction>
<xsl:processing-instruction
      name="cocoon-process">type="xsp"</xsl:processing-instruction>
  <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
   <fo:layout-master-set>
     <fo:simple-page-master master-name="master-pages-for-all"
       page-height="29.7cm"
          page-width="21cm"
     margin-top="1cm"
       margin-bottom="2cm"
       margin-left="2cm"
       margin-right="2cm">
       <fo:region-body margin-bottom="2.5cm"/>
       <fo:region-before extent="2.5cm"/>
       <fo:region-after extent="1.5cm"/>
     </fo:simple-page-master>

     <!-- page-master 3. -->                                       <!--
-->
       <fo:simple-page-master              master-name="landscape"
       page-height="29.7cm"
         page-width="21cm"
         margin-top="1in"
         margin-bottom="1in"
         margin-left = "0.75in"
         margin-right="0.75in">

       <fo:region-body
           reference-orientation="90"
           margin-left="0.6in"
           margin-right="0.6in"/> <!--Region after goes in here.  -->

       </fo:simple-page-master>


     <fo:page-sequence-master master-name="sequence-of-pages">
         <fo:repeatable-page-master-reference master-name
="master-pages-for-all" />
       </fo:page-sequence-master>
 </fo:layout-master-set>

 <fo:page-sequence  master-name="landscape">

     <fo:flow flow-name="xsl-region-body">
        <xsl:apply-templates select="page/landscape"/>
       </fo:flow>
 </fo:page-sequence>

 <fo:page-sequence master-name="master-pages-for-all">
           <fo:static-content flow-name="xsl-region-before">
          <fo:block break-before="page" text-align="center">
          </fo:block>
           </fo:static-content>
           <fo:static-content flow-name="xsl-region-after">
                  <fo:block text-align="center">
                    <xsl:text>Page: </xsl:text>
                         <xsl:value-of select="page/@pgnum"/>
               </fo:block>
          </fo:static-content>

         <fo:flow flow-name="xsl-region-body">
            <xsl:apply-templates select="page"/>
         </fo:flow>

   </fo:page-sequence>


<!-- <xsl:apply-templates/>-->
</fo:root>
</xsl:template>

          <xsl:template match="page/landscape">
              <xsl:apply-templates/>
          </xsl:template>

          <xsl:template match="page">
               <fo:block break-before="page">
                    <xsl:apply-templates/>
                    <!--<xsl:text>Page: </xsl:text>-->
                         <!--<xsl:value-of select="@pgnum"/>-->
               </fo:block>

          </xsl:template>


Here is part of the XML

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book SYSTEM "book.dtd">
<book>
<page pgid="pg1" pgnum="null01" pubid="b683404">
</page>
<page pgid="pg2" pgnum="null02" pubid="b683404">
</page>
<page pgid="pg3" pgnum="i" pubid="b683404">
<title id="x1" level="1">SONNETS</title>
</page>
<page pgid="pg4" pgnum="ii" pubid="b683404">
<footnote id="x30" num="1">
<p id="x2">FOOTNOTES LINKED WITH NUMBERS Five hundred copies of this
book<lb />
have been printed for sale.</p>
</footnote>
<footnote id="x31" num="2" brks="brks"><p id="x3">FOOTNOTE THAT BREAKS This
copy is No. . . . . . . . . . . . . . . .</p></footnote>
<image id="x4" />
</page>
<page pgid="pg31" pgnum="21" pubid="b683404">
<landscape width="504" />
<table id="x112" width="100%" frame="above" rules="groups">
<colgroup>
<col width="1%" align="left" />
<col width="12%" align="right" />
<col width="15%" align="center" />
<col width="15%" align="center" />
<col width="12%" align="center" />
<col width="12%" align="center" />
<col width="12%" align="center" />
<col width="12%" align="center" />
<col width="11%" align="center" />
</colgroup>
<thead>
<tr id="x113">
<th>
</th>
<th>
</th>
<th>
Low</th>
<th colspan="2">
</th>
<th>
Exclusion</th>
<th colspan="2">
</th>
<th>
High</th>
</tr>
</thead>
<tbody>
<tr id="x114">
<td id="x115" colspan="2">
HIGH DEGREE OF<br />
"REVOLUTIONARY<br />
SUCCESS"</td>
<td id="x116" colspan="7">
</td>
</tr>
...............
..................
..........
</book>




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]