cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Turner <je...@apache.org>
Subject Re: Aggregation of xml in a directory
Date Sun, 13 Oct 2002 06:24:56 GMT
On Sat, Oct 12, 2002 at 02:08:16PM +0100, Alex McLintock wrote:
> Hi folks,
> 
> I am trying to figure out how to get Cocoon to display all the xml files in 
> a directory without being explicitly told each of their names in the 
> sitemap.

Have a look at the XPathDirectoryGenerator in the scratchpad. With it,
you can generate a directory listing, with a node extracted from each
file. Eg, I used it to extract <description> elements from a list of Ant
scripts:

http://aft.sourceforge.net/examples/

The relevant config was:

<map:sitemap ..
  <map:components ..
    <map:generators ..
      <map:generator  name="xpathdirectory"
        src="org.apache.cocoon.generation.XPathDirectoryGenerator"/>

  .....
  <!-- examples/index.html, listing all scripts -->
  <map:match pattern="examples/index.xml">
    <map:generate type="xpathdirectory"
      src="content/xdocs/examples#/project/description"/>
    <map:transform
      src="resources/stylesheets/antdirectory2document.xsl"/>
    <map:serialize type="xml"/>
  </map:match>


--Jeff


> I guess I need a combination of the Directory Generator and the Aggregation 
> tools.
> 
> I am not too worried about the order of the files otherwise I would have to 
> use an XML database - which I would like to avoid if possible.
> 
> PS I have looked in the Langham/Ziegeler book but can't find anything 
> useful.
> 
> Do I need to write a DirectoryAggregation Generator in Java? perhaps others 
> would find it useful too.
> 
> Alex

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message