You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Uli Mayring <ul...@denic.de> on 2000/05/25 22:54:13 UTC

XInclude Processor and cocoon food chain

Hiho,

as I wrote in an earlier message I am trying to write a taglib that uses
the XInclude processor internally. (I want to use it to read in parts of
another XML file).

While playing a bit with the cocoon sources I found that I don't actually
understand the internal processing model. But it appears to me that
instantiating my own XInclude processor is not how things are supposed to
be done. Processors are "at the top" of the food chain, whereas taglibs
are more towards the bottom. After all, they get executed by a processor,
the XSP processor. It seems questionable to me to invoke a processor from
a taglib, just because the processor contains some useful code, that I
would need in the taglib as well.

Please, if I've misrepresented anything, correct me. Anyhow, what I want
to ask is:

a) Why is the XInclude thing a processor and not a taglib?

b) I know I have access to the document object within an XSP page. But in
what state is this document object? I guess it is a parsed DOM tree, but
how did it get there? Which stages of the cocoon processing chain have
already been completed, once I get the document in the XSP page? For
example, I tried to put a <xinclude:include...> statement before my own
tag, but the document object I received in my taglib still contained that
xinclude statement (and not the XML code it pointed to), although I put
the XInclude pi first in my XML file.

c) How do I actually use the XIncludeProcessor class? Do I have to call
the init() method? If yes, where do I get the Director from that this
method requires as input?

d) Why does the XIncludeProcessor class receive the current document as
input? I expected that it needs the actual Xinclude statement that it is
supposed to resolve, but not the whole document?

Ok, these questions are probably outrageously stupid. This is the first
time I actually hack cocoon directly. Of course, if anything usable comes
out of it, I'll contribute it. But at this point I doubt it. On the other
hand when I started out with cocoon and XML I also doubted it would be
useful ;-)

Ulrich

-- 
Ulrich Mayring
DENIC eG, Softwareentwicklung