cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gerald Aichholzer <g...@sbox.tugraz.at>
Subject Re: XMLFileModule for a dynamic file.
Date Wed, 01 Jun 2005 14:19:37 GMT
Hello Alexander,

Alexander Berezhnoy wrote:
> Dear friends,
> I've been looking for this feature for a week already, nobody and nowhere
> can't give me a definite answer.
> 
> I want to extract data with XPath from an XML file whoes name depends on
> request parameters.
> The XMLFileModule is statically configured, so the file name is fixed.
> 
> Please, is it possible without writing my own module?
> 

I have had similar problems last week and have solved it with an
aggregator. A simplified version of my pipeline looks like this:

   <map:pipeline match="myapp/*/info.xml">

     <map:aggregate element="document">
       <map:part src="cocoon:/myapp/data/data.xml"/>
       <map:part src="cocoon:/myapp/data/data-{1}.xml"/>
     </map:aggregate>

     <map:transform type="xslt" src="cocoon:/stylesheets/info.xsl"/>

     <map:serialize type="xml"/>
   </map:pipeline>

The pipeline's first stage aggregates the base data with the xml file
(in my case its name is determined by the matcher). The result looks
like the following:

   <document>
     <!-- content of data.xml here -->
     <!-- content of data-{1}.xml here -->
   </document>

The next step is the transformation. For the stylesheet it looks like
everything is in one file (although in reality the content is generated
dynamically depending on the URI).

I can't say if my approach meets your requirements, too, but it fits
my needs perfectly.

HTH,
Gerald

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


Mime
View raw message