Re: Preview for a general XSL-FO processing API

2004-11-28 Thread Jeremias Maerki
Hi Victor

On 27.11.2004 16:53:54 Victor Mote wrote:
 I looked at the doc, and I think this is all pretty useful. I'd like to
 spend some more time on it later, and I think I will probably write a FOray
 implementation after I get 0.2 released. Here are some preliminary thoughts:

I finally downloaded the Foray code yesterday because I thought it might
be fun to write that implementation already. I didn't invest a lot of
time but I got confused about the mixture of Foray and FOP code. Didn't
really know where to start. But that's another story. I should probably
look harder. Anyway, I got a renewed itch now to look at the PS
interpreter. :-)

 1. How do you anticipate deploying this? It looks like the user is aware of
 which implementation he is using, and therefore knows or can find the
 class(es) that implement the interface(s). So it looks like your org.xml.fo
  org.xml.fo.helper stuff would go in some vendor-neutral project, and the
 implementations would simply be part of the vendor package. Does that sound
 right?

Exactly. That's where the whole thing is slightly different to JAXP. I
want to have multiple implementations at the same time and I want to
control which.

Either you set up the classpath yourself and instantiate the right
FOProcessorFactory or you use the XML package format to load an
implementation dynamically along with additional libraries (Barcode4J
comes to mind) and use that.

 2. One thing that I really like about your idea is that, if done properly,
 the implementation classes almost become self-documenting tutorials on the
 API for the specific implementation. If jafop exposes a general API for what
 is needed to process an FO document, then the innards of the implementation
 show how to use the API for the specific implementation.

Right. :-) That one didn't occur to me.

 3. There is more going on here than I anticipated. In org.xml.fo, there are
 four interfaces that a vendor needs to implement. I am not sure what
 FOPEventListener is supposed to do. Of the other three, it looks like two of
 them exist to handle variations in input. I *think* that these could be
 boiled down to just one interface, and that the input variations could be
 handled with overloaded methods or some other way. However, I sure could be
 missing something.

FOPEventListener is an unfinished idea to get information on things
happening inside an FO processor. Examples: Overflow warnings, Missing
images, new pages etc. Nothing's implemented in this direction, yet.

FOProcessor (equivalent to JAXP Transformer) represents the actual FO
processor even if the implementation isn't implemented that way.
Actually, I routed the implementation of the process() method through
the Handler. The main idea is to establish the same structure known from
JAXP. I'm aware that the FOProcessor.process() method will probably
never be used except for trivial examples not involving XSLT.

The FOProcessorHandler is the real work horse IMO. It's used to bind
XSLT output to FO input through SAX events.

The Factory interface is simply responsible to instantiate the
FOProcessor(Handler) implementations.

It's probably best if I just publish the sources so things become
clearer. Will do that later today.

 4. If you think aXSL is an appropriate home for the vendor-neutral pieces of
 this, that would make some sense to me. As we have previously discussed,
 jafop is a subset of what aXSL is supposed to eventually handle. Vendors
 using the app or jafop or whatever part of aXSL would be free to ignore
 the other parts of it, if and when they appear.

The problem with aXSL I've got WRT JAFOP is that it would IMO create
confusion between stuff for FO implementation developers and FO users.
Another point: Sun donated JAXP to the ASF. So the ASF may not be a bad
place after all, as long it's not directly within the FOP source code.
JAXP, Xerces-J and Xalan-J are all in different locations.

 5. I know when I see the substring FOP in the vendor-neutral part of this
 stuff, that it is being used in a vendor-neutral way. However, since the
 general term FO Processor has already been taken by a specific
 implementation, it may be good to find some variation, not only for
 political reasons, but practical as well (cuts down on confusion). Maybe
 something as simple as PFO, or maybe the aXSL name can help here.

That's been bothering me, too. It's also the reason why I mentioned that
the naming can change. :-) I'd also prefer something a little farther
from FOP but nothing really good has occured to me, yet. Good ideas
always welcome. Something with XSL in the name seems problematic to me
because I often run into people who can't distinguish XSL, XSLT and
XSL-FO. Staying near FO would help avoid any confusion.

 I think you have done a good thing here.

Thanks. We'll see what comes out of it.


Jeremias Maerki



Re: Preview for a general XSL-FO processing API

2004-11-28 Thread Jeremias Maerki
I've uploaded the sources (ALv2) to http://www.maerki.org/jeremias/dev/jafop/

In the meantime, I've improved a few things:
- javadocs improved a bit
- added support for specifying a userconfig.xml file for the FOP
maintenance branch implementation (through
FOProcessorFactory.setAttribute(userconfig, filename))
- minimal implementation for JFOR


On 26.11.2004 23:08:50 Jeremias Maerki wrote:
 If there's enough interest I can put the source code for the API plus
 implementations on my website (or to a SF project or somewhere else).


Jeremias Maerki



Re: Preview for a general XSL-FO processing API

2004-11-27 Thread Jeremias Maerki
I'm extremely sorry about not making it clearer that I don't intend to
launch a new API discussion for FOP or that I don't want to force anyone
to do anything. This JAFOP thing is just a personal project I thought
others might be interested in.

Thank you for your suggestions. However, I don't think that EXSLFO would
be the right place as it is focused to standardize on the XSL-FO
language as such, not necessarily on Java API bindings. It could, on the
other side, be launched as a JSR if there is sufficient interest in the
community. It also occured to me that the API might be strong enough to
accomodate other dialects like SVG. But these are just random synaptic
shots.

On 27.11.2004 06:36:47 Glen Mazza wrote:
 As long as a FOP user is not *required* to use it, (i.e., they can 
 ignore JAFOP entirely and still call FOP's native JAXP-based API as in 
 our embed examples), and as long as JAFOP is implemented using our 
 current API, then I don't think I would have much problem with it.  I 
 don't want us to lose our present JAXP capabilities though--JAXP is a 
 useful skill for our users to become proficient in, and something I 
 would like us to continue promoting.
 
 But your idea -- an interface that allows for run-time swapping of FO 
 processors (like JAXP allows for Xalan and Saxon to be switched) is not 
 bad at all.  I wish the folks at AH and RX would create such an 
 interface that we could just implement.  Two thoughts come to mind:  (1) 
 perhaps we should try to reactivate that EXSLFO group and move this 
 topic to them, and (2) you may wish to take a look at the JAXP 
 specification, if you haven't recently, and see if there are any 
 issues/ideas/things you perhaps forgot to take into account, etc., with 
 JAFOP.  That spec should show you what needs to be done for a common 
 interface to be accepted, including things you may have missed.



Jeremias Maerki



RE: Preview for a general XSL-FO processing API

2004-11-27 Thread Victor Mote
Jeremias Maerki wrote:

 I've talked about it before, so in case anybody is interested 
 I've uploaded the Javadocs [1] for a general XSL-FO 
 processing API I've been working on during the last few 
 weeks. It's basically my API proposal that is (or rather was) 
 on the Wiki. I've called it JAFOP (Java API for XSL-FO 
 processing) for now. But naming can change... The 
 implementations for FOP maintenance branch and FOP HEAD 
 already work for simple use cases. No fancy stuff, yet (no 
 events, no userconfig.xml...). 

...

 If there's enough interest I can put the source code for the 
 API plus implementations on my website (or to a SF project or 
 somewhere else).
 
 I believe this common API could be interesting in the 
 following months when FOP HEAD advances. It can be used to 
 easily switch implementations or during development/testing. 
 And I've got a few additional ideas. As time allows...
 
 It might also be interesting to have implementations for 
 Foray, Defoe, XEP and maybe even ol' JFOR. I hope the design 
 is flexible enough to accomodate all Java implementations.

Hi Jeremias:

I looked at the doc, and I think this is all pretty useful. I'd like to
spend some more time on it later, and I think I will probably write a FOray
implementation after I get 0.2 released. Here are some preliminary thoughts:

1. How do you anticipate deploying this? It looks like the user is aware of
which implementation he is using, and therefore knows or can find the
class(es) that implement the interface(s). So it looks like your org.xml.fo
 org.xml.fo.helper stuff would go in some vendor-neutral project, and the
implementations would simply be part of the vendor package. Does that sound
right?

2. One thing that I really like about your idea is that, if done properly,
the implementation classes almost become self-documenting tutorials on the
API for the specific implementation. If jafop exposes a general API for what
is needed to process an FO document, then the innards of the implementation
show how to use the API for the specific implementation.

3. There is more going on here than I anticipated. In org.xml.fo, there are
four interfaces that a vendor needs to implement. I am not sure what
FOPEventListener is supposed to do. Of the other three, it looks like two of
them exist to handle variations in input. I *think* that these could be
boiled down to just one interface, and that the input variations could be
handled with overloaded methods or some other way. However, I sure could be
missing something.

4. If you think aXSL is an appropriate home for the vendor-neutral pieces of
this, that would make some sense to me. As we have previously discussed,
jafop is a subset of what aXSL is supposed to eventually handle. Vendors
using the app or jafop or whatever part of aXSL would be free to ignore
the other parts of it, if and when they appear.

5. I know when I see the substring FOP in the vendor-neutral part of this
stuff, that it is being used in a vendor-neutral way. However, since the
general term FO Processor has already been taken by a specific
implementation, it may be good to find some variation, not only for
political reasons, but practical as well (cuts down on confusion). Maybe
something as simple as PFO, or maybe the aXSL name can help here.

I think you have done a good thing here.

Victor Mote



Re: Preview for a general XSL-FO processing API

2004-11-27 Thread The Web Maestro
This all sounds great to me. I like the sound of it very much. As for  
the javadocs stuff, there's ongoing discussion on the Forrest DEV  
list[1] which discusses 'RAW' files (the category in which Javadocs  
fall). Since that isn't ready yet, perhaps we'll have to go for some  
other javadocs implementation?

As for a 'location' for JAFOP, how about the Objects for Formatting  
Objects (OFFO[2])?

Web Maestro Clay
[1]
http://mail-archives.apache.org/eyebrowse/ReadMsg? 
[EMAIL PROTECTED]msgNo=15979

[2]
http://offo.sourceforge.net/
On Nov 27, 2004, at 12:06 AM, Jeremias Maerki wrote:
I'm extremely sorry about not making it clearer that I don't intend to
launch a new API discussion for FOP or that I don't want to force  
anyone
to do anything. This JAFOP thing is just a personal project I thought
others might be interested in.

Thank you for your suggestions. However, I don't think that EXSLFO  
would
be the right place as it is focused to standardize on the XSL-FO
language as such, not necessarily on Java API bindings. It could, on  
the
other side, be launched as a JSR if there is sufficient interest in the
community. It also occured to me that the API might be strong enough to
accomodate other dialects like SVG. But these are just random synaptic
shots.

On 27.11.2004 06:36:47 Glen Mazza wrote:
As long as a FOP user is not *required* to use it, (i.e., they can
ignore JAFOP entirely and still call FOP's native JAXP-based API as in
our embed examples), and as long as JAFOP is implemented using our
current API, then I don't think I would have much problem with it.  I
don't want us to lose our present JAXP capabilities though--JAXP is a
useful skill for our users to become proficient in, and something I
would like us to continue promoting.
But your idea -- an interface that allows for run-time swapping of FO
processors (like JAXP allows for Xalan and Saxon to be switched) is  
not
bad at all.  I wish the folks at AH and RX would create such an
interface that we could just implement.  Two thoughts come to mind:   
(1)
perhaps we should try to reactivate that EXSLFO group and move this
topic to them, and (2) you may wish to take a look at the JAXP
specification, if you haven't recently, and see if there are any
issues/ideas/things you perhaps forgot to take into account, etc.,  
with
JAFOP.  That spec should show you what needs to be done for a common
interface to be accepted, including things you may have missed.

Jeremias Maerki

Web Maestro Clay
--
[EMAIL PROTECTED] - http://homepage.mac.com/webmaestro/
My religion is simple. My religion is kindness.
- HH The 14th Dalai Lama of Tibet


Re: Preview for a general XSL-FO processing API

2004-11-26 Thread Glen Mazza
Jeremias Maerki wrote:
If there's enough interest I can put the source code for the API plus
implementations on my website (or to a SF project or somewhere else).
I believe this common API could be interesting in the following months
when FOP HEAD advances. It can be used to easily switch implementations
or during development/testing. And I've got a few additional ideas. As
time allows...
It might also be interesting to have implementations for Foray, Defoe,
XEP and maybe even ol' JFOR. I hope the design is flexible enough to
accomodate all Java implementations.
 

As long as a FOP user is not *required* to use it, (i.e., they can 
ignore JAFOP entirely and still call FOP's native JAXP-based API as in 
our embed examples), and as long as JAFOP is implemented using our 
current API, then I don't think I would have much problem with it.  I 
don't want us to lose our present JAXP capabilities though--JAXP is a 
useful skill for our users to become proficient in, and something I 
would like us to continue promoting.

But your idea -- an interface that allows for run-time swapping of FO 
processors (like JAXP allows for Xalan and Saxon to be switched) is not 
bad at all.  I wish the folks at AH and RX would create such an 
interface that we could just implement.  Two thoughts come to mind:  (1) 
perhaps we should try to reactivate that EXSLFO group and move this 
topic to them, and (2) you may wish to take a look at the JAXP 
specification, if you haven't recently, and see if there are any 
issues/ideas/things you perhaps forgot to take into account, etc., with 
JAFOP.  That spec should show you what needs to be done for a common 
interface to be accepted, including things you may have missed.

Glen