You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Goetz Botterweck <bo...@uni-koblenz.de> on 2003/05/16 16:57:21 UTC

from all files in a directory?

I want to configure the sitemap to extract from all files in a directory 
*WITHOUT* listing the files by name. Instead I would like to apply 
someform of wildcard.

I know that I this works

<map:match pattern="index.xml">
   <map:aggregate element="files">
     <map:part src="cocoon:/dir/file1.xml"/>
     <map:part src="cocoon:/dir/file2.xml"/>
   </map:aggregate>
   <map:serialize type="xml"/>
</map:match>

However I would like to do something like this, without listing file1, 
file2, file3 etc.

<map:match pattern="index.xml">
   <map:aggregate element="files">
     <map:part src="cocoon:/dir/file*.xml"/> <!-- wildcard -->
   </map:aggregate>
   <map:serialize type="xml"/>
</map:match>

Does somebody know how to do this?
TIA, Goetz


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


Re: from all files in a directory?

Posted by Andreas Hartmann <an...@apache.org>.
Goetz Botterweck wrote:
> I want to configure the sitemap to extract from all files in a directory 
> *WITHOUT* listing the files by name. Instead I would like to apply 
> someform of wildcard.

You can use a combination of the DirectoryGenerator and the
CIncludeTransformer.

HTH,
Andreas

> 
> I know that I this works
> 
> <map:match pattern="index.xml">
>   <map:aggregate element="files">
>     <map:part src="cocoon:/dir/file1.xml"/>
>     <map:part src="cocoon:/dir/file2.xml"/>
>   </map:aggregate>
>   <map:serialize type="xml"/>
> </map:match>
> 
> However I would like to do something like this, without listing file1, 
> file2, file3 etc.
> 
> <map:match pattern="index.xml">
>   <map:aggregate element="files">
>     <map:part src="cocoon:/dir/file*.xml"/> <!-- wildcard -->
>   </map:aggregate>
>   <map:serialize type="xml"/>
> </map:match>
> 
> Does somebody know how to do this?
> TIA, Goetz



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


RE: from all files in a directory?

Posted by Reinhard Pötz <re...@gmx.net>.
Goetz,

Instead of <map:aggregate .../> I would use the directory generator, a
stylesheet that transforms the result of the directory generator in
valid cinclude elements and then you could use the CInclude Transformer.

Reinhard

> -----Original Message-----
> From: Goetz Botterweck [mailto:botterwe@uni-koblenz.de] 
> Sent: Friday, May 16, 2003 4:57 PM
> To: Cocoon Users ML
> Subject: <map:aggregate> from all files in a directory?
> 
> 
> I want to configure the sitemap to extract from all files in 
> a directory 
> *WITHOUT* listing the files by name. Instead I would like to apply 
> someform of wildcard.
> 
> I know that I this works
> 
> <map:match pattern="index.xml">
>    <map:aggregate element="files">
>      <map:part src="cocoon:/dir/file1.xml"/>
>      <map:part src="cocoon:/dir/file2.xml"/>
>    </map:aggregate>
>    <map:serialize type="xml"/>
> </map:match>
> 
> However I would like to do something like this, without 
> listing file1, 
> file2, file3 etc.
> 
> <map:match pattern="index.xml">
>    <map:aggregate element="files">
>      <map:part src="cocoon:/dir/file*.xml"/> <!-- wildcard -->
>    </map:aggregate>
>    <map:serialize type="xml"/>
> </map:match>
> 
> Does somebody know how to do this?
> TIA, Goetz
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
> 


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


Re: from all files in a directory?

Posted by Stephan Michels <st...@apache.org>.

On Fri, 16 May 2003, Goetz Botterweck wrote:

> I want to configure the sitemap to extract from all files in a directory
> *WITHOUT* listing the files by name. Instead I would like to apply
> someform of wildcard.
>
> I know that I this works
>
> <map:match pattern="index.xml">
>    <map:aggregate element="files">
>      <map:part src="cocoon:/dir/file1.xml"/>
>      <map:part src="cocoon:/dir/file2.xml"/>
>    </map:aggregate>
>    <map:serialize type="xml"/>
> </map:match>
>
> However I would like to do something like this, without listing file1,
> file2, file3 etc.
>
> <map:match pattern="index.xml">
>    <map:aggregate element="files">
>      <map:part src="cocoon:/dir/file*.xml"/> <!-- wildcard -->
>    </map:aggregate>
>    <map:serialize type="xml"/>
> </map:match>
>
> Does somebody know how to do this?

Use the DirectoryGenerator to generate a list of cincludes, which
the CIncludeTransformer executes.

With <aggregate> doesn't it work.

Stephan.


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


RE: from all files in a directory?

Posted by Tim Oesau <ti...@epredix.com>.
I believe it is done like this:

<map:match pattern="**.xml">
  <map:generate src="docs/{1}.xml"/>
  <map:serialize type="xml"/>
</map:match>

-----Original Message-----
From: Goetz Botterweck [mailto:botterwe@uni-koblenz.de] 
Sent: Friday, May 16, 2003 9:57 AM
To: Cocoon Users ML
Subject: <map:aggregate> from all files in a directory?


I want to configure the sitemap to extract from all files in a directory

*WITHOUT* listing the files by name. Instead I would like to apply 
someform of wildcard.

I know that I this works

<map:match pattern="index.xml">
   <map:aggregate element="files">
     <map:part src="cocoon:/dir/file1.xml"/>
     <map:part src="cocoon:/dir/file2.xml"/>
   </map:aggregate>
   <map:serialize type="xml"/>
</map:match>

However I would like to do something like this, without listing file1, 
file2, file3 etc.

<map:match pattern="index.xml">
   <map:aggregate element="files">
     <map:part src="cocoon:/dir/file*.xml"/> <!-- wildcard -->
   </map:aggregate>
   <map:serialize type="xml"/>
</map:match>

Does somebody know how to do this?
TIA, Goetz


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



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