Hi,

I'm trying to write a new source for a custom protocol to proprietary
backend. the Source would inherit from
org.apache.cocoon.environment.ModifiableSource.
Now so far so good, but there are two ways such as Source can deliver its
XML as I understood:

- via toSAX()
- via getInputStream()/Source()

Now as it comes out my source needs both choices depending on the URL.
Because on the one hand I want to create SAX events for some object on the
other hand get a stream from the backend that contains already XML and
just want to pass it on.

Furthermore when I look at the code of existing sources I'm not getting
the idea how a source really works? I mean the SAX events have nothing to
do with the stream, is it two choices for a source or what? There are some
sources that only use toSAX(), some that use only streams, some that use
both.

Last but not least, the refresh() method of a ModifiableSource, when is it
being called? Is it the idea that a source keeps the data that it gets
from e.g. the backend and gives back that data whenever someone calls
toSAX or getInputStream() and only re-fetch that data in refresh()? Or can
one re-fetch the data with each request? And is there any way to influence
when refresh() is being called and what is the "default"?


Thanks for any help, Peter



---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

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

Reply via email to