cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Unico Hommes" <Un...@hippo.nl>
Subject About (XPath)TraversableGenerator
Date Thu, 02 Oct 2003 14:01:25 GMT

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).

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.

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.

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

-Unico-

Mime
View raw message