RE: FOP extension element

2002-07-31 Thread Matthew L. Avizinis
);
out.write("
Once all this is in place you should be able to just build FOP in the normal
way.  WritePageNumber.class will be put into the fop.jar.
To use the element place   xmlns:fop="http://xml.apache.org/fop/extensions";
in the xsl:stylesheet element and specify the element as described below.
When FOP is run you will end up with your pdf and an extra xml file.  To
make sure it is a valid xml file, make sure that the first time
WritePageNumber is used to include file="new" and that WritePageNumber
includes file="end" the last time it is used to properly close the root
element, whatever that happens to be.  The root element only has to be
specified once with file="new" if you want to use an element name other than
the default one because when file="end" is used the root element will be
read from the file being written and closed appropriately.
Finally, I am sure there are corrections that can be made to the code.  I
have not been programming in Java nearly as long as some of you in this
list, so please be kind with your critique.  Be that as it may, the code
works (with at least 0.20.4) and I think the element is rather nifty and I'd
be glad to hear if any of you use it in an interesting way.
Have fun,
   Matthew L. Avizinis <mailto:[EMAIL PROTECTED]>
Gleim Publications, Inc.
   4201 NW 95th Blvd.
 Gainesville, FL 32606
(352)-375-0772
  www.gleim.com <http://www.gleim.com>

===
com·put·ing (kum' pyoot ing)
1. n the art of calculating how much time you wasted and money you spent in
a doomed attempt to master a machine with a mind of it's own. --from
computing: A HACKER'S DICTIONARY




> -Original Message-
> From: Matthew L. Avizinis [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 29, 2002 3:00 PM
> To: [EMAIL PROTECTED]
> Subject: FOP extension element
>
>
> 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  is used by default.
> If a child element is not specified  is used by default.
> file = "new | append | end"
> id = "string value"
> filename = "string value"
>
> So if you wrote:
>  element-name="indexterm" id="primary_test1"/>
>  id="secondary_test2"/>
>  element-name="indexterm" id="secondary_test3"/>
>
> you could have in file index.xml (page numbers chosen arbitrarily for this
> example):
> 
>   325
>   326
>   327
> 
>
> 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
> file.
>
> 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
> (352)-375-0772
>   www.gleim.com <http://www.gleim.com>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]


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




RE: FOP extension element

2002-07-29 Thread Matthew L. Avizinis

I meant to say, it's not particularly pretty code, but it works.  It's
simple so it shouldn't really have any defects.

>
> 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 
> Gleim Publications, Inc.
>4201 NW 95th Blvd.
>  Gainesville, FL 32606
> (352)-375-0772
>   www.gleim.com 
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]


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




FOP extension element

2002-07-29 Thread Matthew L. Avizinis

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  is used by default.
If a child element is not specified  is used by default.
file = "new | append | end"
id = "string value"
filename = "string value"

So if you wrote:




you could have in file index.xml (page numbers chosen arbitrarily for this
example):

  325
  326
  327


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
file.

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
(352)-375-0772
  www.gleim.com <http://www.gleim.com>


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