Hello all,
  I have written an FOP extension element, fop:WritePageNumber, which
outputs the page number where the element occurs in the fo document.  It has
several properties which allow to specify a filename, whether to start a new
file, append to an existing file, or close the root element of an existing
file, a root-element, child element-name, an id for the element.

If a root element is not specified <info> is used by default.
If a child element is not specified <x-ref> is used by default.
file = "new | append | end"
id = "string value"
filename = "string value"

So if you wrote:
<fop:WritePageNumber filename="index.xml" file="new" root-element="index"
element-name="indexterm" id="primary_test1"/>
<fop:WritePageNumber filename="index.xml" element-name="indexterm"
<fop:WritePageNumber filename="index.xml" file="end"
element-name="indexterm" id="secondary_test3"/>

you could have in file index.xml (page numbers chosen arbitrarily for this
  <indexterm id="primary_test1">325</indexterm>
  <indexterm id="secondary_test2">326</indexterm>
  <indexterm id="secondary_test3">327</indexterm>

This has been useful for me because it allows me to process many chapters of
a book individually through FOP then put them together and still produce an
index and various other cross references across chapters.  It also allow the
generation of a table of contents without having to use forward page
references and thus the necessity of processing all chapters as one big

If anyone else thinks this is something useful, I will post the code for
review.  It's not perfect code but it works.

   Matthew L. Avizinis <mailto:[EMAIL PROTECTED]>
Gleim Publications, Inc.
   4201 NW 95th Blvd.
 Gainesville, FL 32606
      www.gleim.com <http://www.gleim.com>

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to