cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Turner <je...@apache.org>
Subject Re: XML input module (was: RE: Nice changes!)
Date Mon, 30 Sep 2002 15:31:25 GMT
On Mon, Sep 30, 2002 at 04:56:36PM +0200, Christian Haul wrote:
> On 30.Sep.2002 -- 09:59 PM, Jeff Turner wrote:
> > On Mon, Sep 30, 2002 at 01:19:04PM +0200, Christian Haul wrote:
> > > I would prefer that module to be a "meta" module that can be
> > > configured to take input from any source (i.e. another InputModule)
> > > rather than do the reading itself.
> > 
> > >From what I gather, Meta modules take in as input, a) another module, b)
> > a configuration. In this scenario, what object would we feed JXPath?
> > Where does the DOM come from?
> 
> As already pointed out in others' replies, jxpath can operate on more
> than DOM, i.e. uses reflexion to obtain the get and set methods.
....
> > This might already be possible, since I think JXPath can traverse from
> > the Session object to a DOM.
> 
> Yes. The current request InputModule uses jxpath and allows this
> functionality. However, I believe this is a feature that deserves to
> be universally plugable.

It is universally pluggable, only the plugin mechanism is inheritance,
not composition. The current model is:

AbstractJXPathModule .
                     |---- RequestModule
                     |---- SessionModule
                     |---- XMLModule
                     +---- ....

Where each subclass just chooses what Object to let JXPath use.

If I've understood you, you're proposing to change from inheritance to
composition. Create a JXPathModule that takes as 'input', *any* other
module:

<component-instance name="jxpath" class="...JXPathModule">
  <input-module name="SessionModule"/>
</component-instance>

The JXPath module then provides XPath access to the input-module's....
what? This is my question above. A Module's public interface doesn't
allow access to the raw object model that JXPath needs. It's always
pre-digested, accessible through tokens that the Module defines. For
instance, how would the above XML snippet translate to code? How could
XMLModule functionality be achieved?

IMHO, inheritance is the way to go, with more advanced "chaining"
functionality layered underneath, so that any subclass can automatically
be chained.


--Jeff

> 	Chris.
> -- 
> C h r i s t i a n       H a u l
> haul@informatik.tu-darmstadt.de
>     fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message