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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to