cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bertrand Delacretaz <bdelacre...@codeconsult.ch>
Subject Re: Xinclude + regex (?) AKA How do I include all of the xml files in a directory?
Date Mon, 17 Jun 2002 12:57:53 GMT
On Monday 17 June 2002 14:38, John Moylan wrote:
> I have multiple XML documents in a directory and I need to generate an
> index for same on the fly. 
>. . .

One approach is to use the DirectoryGenerator to get the list of files in 
your directory, and manipulate it with an XSLT transform to generate a 
document suitable for XInclude (or CInclude, the Cocoon version, which is 
more flexible AFAIK).

You can then use an aggregate to combine this with your index html file, 
something like (sitemap excerpts):

<!-- use DirectoryGenerator + XSLT to prepare for CInclude -->
<map:match pattern="cinclude-src.xml">
 . . .

<!-- pass cinclude-src.xml through CInclude transformer-->
<map:match pattern="files-list.xml">
  <map:generate src="cocoon:/cinclude-src.xml"/>
  <map:transform type="cinclude"/>
 . . .

<!-- use HTMLGenerator to parse HTML file -->
<map:match pattern="index.xml">
 . . .

<map:match pattern="index.html">
  <!-- put it all together -->
  <map:aggregate element="index">
    <map:part element="files" src="cocoon:/files-list.xml"/>
    <map:part element="index" src="cocoon:/index.xml"/>
  </map:aggregate>
   <!-- apply XSLT, etc. -->
 . . .

Hope this helps!
-- 
 Bertrand Delacrétaz (codeconsult.ch, jfor.org)

 buzzwords: XML, java, XSLT, cocoon, mentoring/teaching/coding.
 disclaimer: eternity is very long. mostly towards the end. get ready.






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