cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Unico Hommes" <>
Subject RE: About (XPath)TraversableGenerator
Date Thu, 02 Oct 2003 14:40:20 GMT

Gianugo Rabellino wrote:
> > 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.

OTOH, the TraversableGenerator is still a in the scratchpad area. If we want to ever change
this we should do it now. If someone protests we could make the behavior configurable.
> > 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?

If you do:

<map:generate src="myresource" />

but myresource does not exist, it will not be an error but xml will be generated just the

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

OK, I could make it a conjunction: xml resources are those that either have a mime mapping
according to the Context object or that match the pattern that is passed in as a sitemap parameter.
Or I could make it an exclusive disjunction: only look at the Context object if sitemap parameter
is not 

Wich one do you think is preferable?

>  > What do you think? Should I go ahead and prepare a patch?
> Always most welcome. :-)
> Ciao,
> -- 
> Gianugo Rabellino
> Pro-netics s.r.l. -
> Orixo, the XML business alliance -
>      (Now blogging at:

View raw message