cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gianugo Rabellino <>
Subject Re: About (XPath)TraversableGenerator
Date Thu, 02 Oct 2003 14:23:50 GMT
Unico Hommes wrote:
> Hi,
> Using TraversableGenerator I noticed a limitation and a potential bug. 
> The limitation is that generate() throws a SourceNotFoundException if the input Source
is not a collection. I'd like to use this generator also to view some meta information on
<collection:resource>s without having to generate all of the contents of its parent
and then harvesting only those things I need. (the davmap sample would also benefit from this
feature as it could reduce the number of traverse2propfind transformation sheets from two
to only one).

Agreed. That behaviour came straight from the DirectoryGenerator, I 
think there is no particular need to keep it. I don't know, though, if 
some users are already depending on the "directories only" contract.

> The bug is that the input sources are not tested for their existence wich means that
it is perfectly legal to specify a non-existing source as the input source.

I don't see the point here. Care to delve a bit more?

> One last thing I'd want to know is about the way XPathTraversableGenerator locates xml
files for xpath inspection. According to the docs "it will perform an XPath query on every
XML resource, where "xmlresource" is, by default, any resource ending with ".xml", which can
be overriden by setting the (regexp) pattern "xmlFiles as a sitemap parameter." A more general
way would be to use the o.a.c.e.Context object's capabilities to map files to mime types and
then apply xpath inspection on all "text/xml" types. This way all container-wide mime mappings
(such as those parsed in from web.xml) are used.

That might be just OK, as long as all others behaviour remain... 
sometimes mime-types mapping is not applicable.

 > What do you think? Should I go ahead and prepare a patch?

Always most welcome. :-)


Gianugo Rabellino
Pro-netics s.r.l. -
Orixo, the XML business alliance -
     (Now blogging at:

View raw message