<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Ken,<br>
<br>
Thank you very much for your comments. It helps me a lot.<br>
<br>
Yes, I am imagining a feedback loop from the XSL-FO compose engine. <br>
<br>
My situation is:<br>
I have an XML file with some page break information in it like the
following:<br>
<br>
<small><font face="Courier New">&lt;book&gt;<br>
&nbsp;&nbsp;&nbsp; <font color="#990000">&lt;pagest page_number="1" manual_name="How
to cook Chinese food by your self" title=""&gt;</font><br>
&nbsp;&nbsp;&nbsp; &lt;title&gt;How to cook Chinese food by your self&lt;/title&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;Author&gt;The big chef&lt;/Author&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;chapter chapnbr="1"&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &lt;title&gt;Introduction&lt;/title&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &lt;para&gt;Welcome to the food world ........ &lt;/para&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &lt;para&gt;...&lt;/para&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &lt;para&gt;...&lt;/para&gt;<br>
<br>
</font><font face="Courier New"><font color="#cc0000">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &lt;pagest
page_number="2" manual_name="How to cook Chinese food by your self"
title="Introduction"&gt;</font><br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; </font><font face="Courier New">&lt;para&gt;Before you decide
to cook your self ........&lt;/para&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &lt;para&gt;...&lt;/para&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &lt;para&gt;...&lt;/para&gt;</font><br>
</small><font face="Courier New"><small>&nbsp;&nbsp;&nbsp; &lt;/chapter&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;chapter chapnbr="2"&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; </small></font><small><font face="Courier New"><font
 color="#cc0000">&lt;pagest page_number="10" manual_name="How to cook
Chinese food by your self" title="Chinese food culture"&gt;</font></font></small><br>
<font face="Courier New"><small>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &lt;title</small></font><font
 face="Courier New"><small>&gt;Chinese food culture&lt;title&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; </small></font><small><font face="Courier New">&lt;para&gt;...&lt;/para&gt;</font></small><br>
<font face="Courier New"><small>&lt;/book&gt;</small><br>
<br>
</font>I would like to print the page information in header. <br>
<br>
In XSL-FO, we can do the following generate header:<br>
<br>
<small><font face="Courier New">&lt;fo:static-content
flow-name="content-region-before"&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;fo:block&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;fo:block&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; How to cook Chinese food by your self<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/fo:block&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;fo:leader leader-length="7.69in" leader-pattern="rule"
rule-thickness="0.5mm" color="black" /&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;/fo:block&gt;<br>
&lt;/fo:static-content&gt;</font></small><br>
<br>
But the header above is static. In my situation, the contents in the
header are dynamic and vary from page to page. <br>
<br>
Originally and naturally (maybe not the way which XSL-FO want me but my
own way), I was thinking about I get the page information and put it
into header when there is a page break event from RenderX compose
engine.<br>
<br>
Another solution I was ever thinking about is each page use one
fo:page-sequence. But this will not work because the page break can be
in the middle of an element, for an example: in the middle of a list. <br>
<br>
Thank you very much &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; <br>
<br>
JingJun Long<br>
<br>
<br>
G. Ken Holman wrote:
<blockquote
 cite="mid7.0.1.0.2.20070327063423.02a3d2e8@CraneSoftwrights.com"
 type="cite">At 2007-03-27 10:21 +0800, JingJun Long wrote:
  <br>
  <blockquote type="cite">I have a requirement like the following:
    <br>
    <br>
I would like to control the generation of header and footer.
    <br>
    <br>
Let's say there is a new page started. Before the engine generate
header and footer, is there any event from RenderX compose engine like
"new_page_event".
    <br>
  </blockquote>
  <br>
Where do you want this event to show up?&nbsp; In XSLT?
  <br>
  <br>
The XSL formatting model dictates that XSLT transformation be entirely
complete before XSL-FO processing can begin.&nbsp; There is no feedback
loop.&nbsp; For my XSL students who have a background in Frame or PageMaker
or InDesign, they are surprised to hear that the XSL model is "arms
length" in that the XSLT transformation must inject contingencies into
the XSL-FO expression because the XSL-FO engine has no way of
communicating formatting status back to the XSLT process.
  <br>
  <br>
>From your brief description I get the impression you are imagining a
feedback loop to your XSLT transform that is occurring during the
XSL-FO layout process.
  <br>
  <br>
But perhaps I am misunderstanding the processes you are asking about,
since I am assuming your question is similar to the questions of some
of my students.
  <br>
  <br>
  <blockquote type="cite">Just like a hook. I can write my own code to
handle this event. So that I can prepare the data which will appear in
header or footer?
    <br>
  </blockquote>
  <br>
The XSL-FO model requires all header and footer content of all pages to
be placed into the XSL-FO instance before the formatting of the very
first page.
  <br>
  <br>
  <blockquote type="cite">Or do you have other mechanism to handle
requirement like this?
    <br>
  </blockquote>
  <br>
Instead of asking your question the way you have, can you describe what
it is you want in your headers and footers?&nbsp; I think you have
presupposed a processing model that doesn't work the way you imagine.&nbsp;
If you describe your requirement as a formatting requirement (not as a
processing requirement) then perhaps someone on the list can suggest
how you can get what you need with the processing model as it is
implemented.
  <br>
  <br>
I hope this helps.
  <br>
  <br>
. . . . . . . . . . . . . . Ken
  <br>
  <br>
  <br>
--
  <br>
World-wide corporate, govt. &amp; user group XML, XSL and UBL training
  <br>
RSS feeds:&nbsp;&nbsp;&nbsp;&nbsp; publicly-available developer resources and training
  <br>
G. Ken Holman&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a class="moz-txt-link-freetext" href="mailto:gkholman@CraneSoftwrights.com">mailto:gkholman@CraneSoftwrights.com</a>
  <br>
Crane Softwrights Ltd.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a class="moz-txt-link-freetext" href="http://www.CraneSoftwrights.com/f/">http://www.CraneSoftwrights.com/f/</a>
  <br>
Box 266, Kars, Ontario CANADA K0A-2E0&nbsp;&nbsp;&nbsp; +1(613)489-0999 (F:-0995)
  <br>
Male Cancer Awareness Aug'05&nbsp; <a class="moz-txt-link-freetext" href="http://www.CraneSoftwrights.com/f/bc">http://www.CraneSoftwrights.com/f/bc</a>
  <br>
Legal business disclaimers:&nbsp; <a class="moz-txt-link-freetext" href="http://www.CraneSoftwrights.com/legal">http://www.CraneSoftwrights.com/legal</a>
  <br>
  <br>
-------------------
  <br>
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
  <br>
in the body of the message to <a class="moz-txt-link-abbreviated" href="mailto:majordomo@renderx.com">majordomo@renderx.com</a> from the address
  <br>
you are subscribed from.
  <br>
(*) By using the Service, you expressly agree to these Terms of Service
<a class="moz-txt-link-freetext" href="http://www.renderx.com/terms-of-service.html">http://www.renderx.com/terms-of-service.html</a>
  <br>
  <br>
</blockquote>
<br>
</body>
</html>