cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gianugo Rabellino <gian...@apache.org>
Subject Re: DirectoryGenerator
Date Wed, 01 Oct 2003 09:31:47 GMT
Alfred Fuchs wrote:
> 
> assume the directory-structure to scan is:
> <ROOTDIR>
>     htmldir
>         hallo.html
>     emptydir
>     nomatchingdir
>     hallo.txt
> 
> 
> the generator
> <map:generate type="directory" src="<ROOTDIR>">
>     <map:parameter name="depth" value="3" />
>     <map:parameter name="include" value="\.(xml|html)$" />
> </map:generate>
> 
> produces this:
> <dir:directory name="<ROOTDIR>" .../>
> 
> ups!
> because, the include-pattern is also applied to directories.

That's interesting. I guess, however, than that the best solution would 
be patching the real DirectoryGenerator (in doing so please sync the 
*TraversableGenerator in scratchpad too).

> ========================
> the difference between the PipelineDirectoryGenerator and
> the XPathDirectoryGenerator:
> 
> the XPathDirectoryGenerator reads a xml-file, applies a XPath-query and
> adds the result as content to the <dir:file>-tag.
> 
> if the PipelineDirectoryGenerator finds a matching file (f.e. 
> path/hello.xml)
> it tries to get content from a matching pipeline (in the example: 
> "cocoon:/content-pipeline/path/hello.xml")
> and adds the result as content to the <dir:file>-tag.

Delegating the inclusion to another pipeline looks pretty neat and 
definitely useful, but I don't feel like this should be the job of a 
monolithic generator. How about turning that part into a transformer who 
reads the DG/TG output and does exactly what you're planning?

Ciao,

-- 
Gianugo Rabellino
Pro-netics s.r.l. -  http://www.pro-netics.com
Orixo, the XML business alliance - http://www.orixo.com
     (Now blogging at: http://blogs.cocoondev.org/gianugo/)


Mime
View raw message