gerritjan wrote:

Hello,

Using the document() function for aggregation in Cocoon may break Separation of Concerns (SoC). That is, the designers of Cocoon view inclusion and transformation as different functions, best handled by separate Cocoon components. Treating them separately allows you to achieve performance gains and increases the resusability of your pipelines.

<snip what="code"/>


Question's
Am I mixing concerns here?

I think so, but I'm no expert :)


How can I avoid document()?

Use the CInclude transformer. Specifically, I bet you could cleverly combine the DirectoryGenerator, and the CIncludeTransformer in a way to duplicate this functionality.


I would expect the pipeline snippit to look something like this:

<map:match pattern="autoindex">
  <map:generate type="directory" src="any/dir/"/>
  <map:transform src="xslt/dir2cinclude.xsl"/>
  <map:transform type="cinclude"/>
  <map:transform src="xslt/listing2html.xsl"/>
  <map:serialize type="xhtml"/>
</map:match>


dir2xinclude.xsl would then just transform the directory listing into cinclude statements, and the rest is simple.


It looks to me that if I would like only certain files that the Xdirectory generator would need that information in the XPATH parameter, is that possible?

Hmm, I'm not sure I follow you. If you're talking about only including files which are named in a certain way, you can pass the xpathdirectory generator a "xmlFiles" parameter which contains a regexp to match files. Check the docs at http://cocoon.apache.org/2.1/userdocs/generators/xpathdirectory-generator.html




Gerritjan


Regards,

Tony


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



Reply via email to