xsl-list
[Top] [All Lists]

Re: [xsl] XSL-FO beginner's question

2009-09-28 17:37:42
Ladies and Gentlemen of the xsl-list,

First of all, thanks, Ken, for the speedy reply.

Seoncdly, thanks for heads of on your training session. My boss and I discussed 
this a week ago as something helpful for me. In the meantime, I will have to 
make due with my failing around....

Thirdly, some more details on my problem, since I am still not getting any 
results.

0) DRIVER STYLESHEET which calls A and should also call B has this form:
<xsl:stylesheet>

<!--stylesheet includes-->
<xsl:include href="./A.xsl"/> <!-- after the contents in print/web permission 
-->
<xsl:include href="./B.xsl"/> <!-- needs to be positioned on its own page at 
the very end -->

  <!--master template-->
  <xsl:template match="TEAMS_ASSET_FILE">
    <fo:root>
      <fo:layout-master-set>
       <fo:simple-page-master master-name="first" />
       <fo:simple-page-master master-name="rest" />
      </fo:layout-master-set>

      <!-- flow for first page-->
      <fo:page-sequence master-reference="first">
         <fo:static-content flow-name="xsl-region-start">
         </fo:static-content>
         <fo:static-content flow-name="xsl-region-after">
        </fo:static-content>
         <fo:flow flow-name="xsl-region-body">
            <fo:block font-size="8pt" text-align="center">
               <xsl:apply-templates select="//UOIS" mode="cover"/>
            </fo:block>
        </fo:flow>
      </fo:page-sequence>

      <!-- flow for the other pages -->
      <fo:page-sequence master-reference="rest">
         <fo:static-content flow-name="xsl-region-before">
         </fo:static-content>
        <fo:static-content flow-name="xsl-region-after">
        </fo:static-content>
         <fo:flow flow-name="xsl-region-body">
            <xsl:apply-templates select="//UOIS" mode="captions"/>
            <fo:block id="last-page"/>
        </fo:flow>
      </fo:page-sequence>
    </fo:root>
  </xsl:template>

  <xsl:template match="UOIS[(_at_)MODEL_ID = $REQUEST_MODEL_ID]" mode="cover">
     <fo:table></fo:table>
  </xsl:template>
</xsl:stylesheet>


A) The correctly working pages 2 - ?? has this form:

<xsl:stylesheet>
<xsl:template match="UOIS[(_at_)MODEL_ID = $IMAGE_MODEL_ID or @MODEL_ID = 
$TMS_IMAGE_MODEL_ID]" mode="captions">
<fo:table> </fp:table>
</xsl:template>
</xsl:stylesheet>

B) the new stylesheet B.xsl containing only static content to be placed at the 
very end now has this form, following my understanding of Ken's recommendations:

<xsl:stylesheet>
<fo:page-sequence master-reference="last" force-page-count="no-force">
    <fo:static-content flow-name="xsl-region-start">
        <fo:table>
        </fo:table>
    </fo:static-content>
    <fo:static-content flow-name="xsl-region-body">
        <fo:table>
        </fo:table>
    </fo:static-content>
</fo:page-sequence>
</xsl:stylesheet>


Am I on track? I still cannot get B.xsl to appear in the output tree.


Mark










--- On Mon, 9/28/09, G. Ken Holman <gkholman(_at_)CraneSoftwrights(_dot_)com> 
wrote:

From: G. Ken Holman <gkholman(_at_)CraneSoftwrights(_dot_)com>
Subject: Re: [xsl] XSL-FO beginner's question
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Date: Monday, September 28, 2009, 1:51 PM

At 2009-09-28 13:41 -0700, mark bordelon wrote:
Gentlemen,

BTW, there are *many* ladies who know this technology very
well, and who are on this list.

I am having difficulty breaking into the complexities
of FO

We are teaching XSL-FO in Washington DC in November
covering all of XSL-FO 1.0 and 1.1 ... this follows a week
of XSLT/XQuery/XPath at the same location.  Details
linked from our home page.

and have an assignment at work which is proving
daunting. THis list has helped me so much with XSL that I
thought someone here would indulge me in a simple start-up
question.

We have a free excerpt of the PDF book on XSL-FO that we
sell that you can download from our web site that goes into
some basics you will probably find very helpful. 
Details linked from our home page.

Here goes. I have some XML and an XSL-FO style sheet
which generates exactly one page of dynamic content
transformed from the xml. It itself includes another
stylesheet which dynamically generates an undefinined number
of pages to follow the first page. These work fine and I do
not wish to change them (!).
My task is deceptively simple for me. I have to
augment the first driver stylesheet to allow for the
inclusion of another XSL-FO stylesheet which should generate
exactly one page of purely static text, which must be the
last page of the entire PDF.

Can anyone give me the most basic start-off template
for this last, static page, and how to include it to assure
the correct positioning at the end?

By using multiple page sequences.  You are already
using at least one page sequence for the content you have
(you might be using two, one for your title page and one for
your content).

Follow after the end of your current last
<page-sequence> with a new <page-sequence> that
has your static last page.

I hope this helps.

. . . . . . . . . . . Ken

<?xml version="1.0"
encoding="US-ASCII"?><!--mark.fo-->
<root xmlns="http://www.w3.org/1999/XSL/Format";
      font-family="Times"
font-size="20pt">

  <layout-master-set>
    <simple-page-master master-name="frame"
               
        page-height="297mm"
page-width="210mm"
               
        margin-top="15mm"
margin-bottom="15mm"
               
        margin-left="15mm"
margin-right="15mm">
      <region-body
region-name="frame-body"/>
    </simple-page-master>
  </layout-master-set>

  <page-sequence master-reference="frame">
    <flow flow-name="frame-body">
      <block>This is your first page
of content</block>
    </flow>
  </page-sequence>

  <page-sequence master-reference="frame">
    <flow flow-name="frame-body">
      <block>
        This is where all your
indeterminate length of content goes
      </block>
    </flow>
  </page-sequence>

  <page-sequence master-reference="frame">
    <flow flow-name="frame-body">
      <block>This is your last page of
fixed content.</block>
    </flow>
  </page-sequence>
</root>


--
Upcoming hands-on code list, UBL, XSLT, XQuery and XSL-FO
classes.
Interested in other classes?  http://www.CraneSoftwrights.com/s/i/
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Training tools: Comprehensive interactive XSLT/XPath
1.0/2.0 video
Video lesson:    http://www.youtube.com/watch?v=PrNjJCh7Ppg&fmt=18
Video overview:  http://www.youtube.com/watch?v=VTiodiij6gE&fmt=18
G. Ken Holman           
     mailto:gkholman(_at_)CraneSoftwrights(_dot_)com
Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--






--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>