Re: Aggregation of xml in a directory

2002-10-14 Thread Martin Lüthi

Hi

Upon recommendation from this list, I initially used XPathDirectoryGenerator,
but it was too slow for online use. Since I know when a file is changed, I
call the following URL which produces one large XML file with the contents of
all files in the directory.

A FileChainingGenerator would probably be a better solution, but here I have a
full Cocoon XML/XSLT solution.  Not very elegant, but at least it works. If
somebody comes up with something better, I'll be happy ;-)

Cheers Martin


The sitemap entry:



  
 
 
 
  
  
  
  
 
   
  
  
   


The stylesheet aggregate.xsl (makes list of XLinks)





http://www.w3.org/1999/XSL/Transform";
  xmlns:dir="http://apache.org/cocoon/directory/2.0"; 
  xmlns:xi="http://www.w3.org/2001/XInclude";
  version="1.0">

  

  

  

  

  




  




The stylesheet sourcewrite.xsl (makes the sourcewriting tags)





http://www.w3.org/1999/XSL/Transform";
version="1.0">

  
  

  
http://apache.org/cocoon/source/1.0";>

  

  

  






Jeff Turner <[EMAIL PROTECTED]> writes:

> 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  elements from a list of Ant
> scripts:
> 
> http://aft.sourceforge.net/examples/
> 
> The relevant config was:
> 
> src="org.apache.cocoon.generation.XPathDirectoryGenerator"/>
> 
>   .
>   
>   
>src="content/xdocs/examples#/project/description"/>
>src="resources/stylesheets/antdirectory2document.xsl"/>
> 
>   
> 
> 
> --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. 
> 
> To unsubscribe, e-mail: <[EMAIL PROTECTED]>
> For additional commands, e-mail:   <[EMAIL PROTECTED]>
> 
> 

-- 
Martin Lüthi [EMAIL PROTECTED]



-
Please check that your question  has not already been answered in the
FAQ before posting. 

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>




Re: Aggregation of xml in a directory

2002-10-13 Thread Jeff Turner

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  elements from a list of Ant
scripts:

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

The relevant config was:



  .
  
  



  


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

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>




Re: Aggregation of xml in a directory

2002-10-13 Thread Alex McLintock


>Alex McLintock wrote:
>>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.
>>I guess I need a combination of the Directory Generator and the 
>>Aggregation tools.
At 14:34 12/10/02, Steven Noels wrote:
>Better: combine the DirectoryGenerator with the CInclude Transformer.


Thanks for the suggestion Steven. What I have done is to write a perl 
script which I run whenever the xml files are updated. This generates an 
XML file which includes all the others in the directory. So in the end I 
don't use DirectoryGenerator or Aggregation in Cocoon - but CInclude works 
fine.

(I better figure out CachingCInclude too.)

Alex





Openweb Analysts Ltd, London.
Software For Complex Websites http://www.OWAL.co.uk/
Open Source Software Companies please register here 
http://www.OWAL.co.uk/oss_support/


-
Please check that your question  has not already been answered in the
FAQ before posting. 

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>




Aggregation of xml in a directory

2002-10-12 Thread Alex McLintock

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.

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




Openweb Analysts Ltd, London.
Software For Complex Websites http://www.OWAL.co.uk/
Open Source Software Companies please register here 
http://www.OWAL.co.uk/oss_support/


-
Please check that your question  has not already been answered in the
FAQ before posting. 

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>




Re: Aggregation of xml in a directory

2002-10-12 Thread Steven Noels

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.
> 
> I guess I need a combination of the Directory Generator and the 
> Aggregation tools.

Better: combine the DirectoryGenerator with the CInclude Transformer.


-- 
Steven Noelshttp://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
[EMAIL PROTECTED]  [EMAIL PROTECTED]


-
Please check that your question  has not already been answered in the
FAQ before posting. 

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>