Maybe you want to have look at xpath directory generator. it let's you create a huge xml file out of any xpath expression performed on any number of xml files in specific directory. Doing so, you will get a new cachable xml-file (depends on your sitemap configuration) with a lot of additional information in like the date each file was last modified. The bad thing about xpath directory generator is, that it isn't fast. if you have quite a number of files to process. I use it with a directory of about 500 files 10K each and, well, the response time is quite long. However if the files aren't changed the chache does a good job. Maybe you want also look at cinclude or xinclude transformers.
<http://cocoon.apache.org/2.1/userdocs/generators/directory-generator.html> <http://cocoon.apache.org/2.1/userdocs/transformers/cinclude-transformer.html> Markus On Fri, 11 Feb 2005 12:03:42 -0500, Ryan Davis <[EMAIL PROTECTED]> wrote: > > > > I'm doing my first real cocoon project, and have things working the way I > want, but it seems a bit convoluted, and I wanted to just run it by the > folks here to see if I'm missing something obvious. > > > > The problem: > > The client wants a folder of xml files, each file representing one member of > his staff. He wants them as separate files so he can add/edit/delete them > easily. They should all appear on his "staff" page. > > > > My solution: > > Since I don't know how many XML files, or their names, that seemed to rule > out a <map:aggregate>, so the only thing I could think of was to use a > <map:generate type="directory"> to get all the file names in XML, then pass > that through an XSLT to produce something like: > > > > <xsl:template match="StaffList"> > > <xsl:apply-templates select="document('rel/path/to/staff1.xml')"/> > > <xsl:apply-templates select="document('rel/path/to/staff2.xml')"/> > > <xsl:apply-templates select="document('rel/path/to/staff3.xml')"/> > > <!-- Etc --> > > </xsl:template> > > > > So, I have one matcher that produces an XSLT like that, and then in my > primary matcher, I conditionally add a <map:transform > src="cocoon:/path/to/stafflist.xslt"/> to the pipeline, depending on if I'm > serving the staff page. That way, the staff page contains a <StaffList> > that will get transformed by the dynamic XSLT to contain all the individual > staff entries. > > > > I've generalized the process, and am using it for a couple of pages. > > > > The only problems I run into are some odd caching behavior where the dynamic > XSLT won't regenerate when a file on disk has been added or removed. > Touching my main site template file invalidates the cache, but I'm guessing > there's a better way around that. > > > > Does that sound like a reasonable solution? Is there something simpler that > I'm overlooking? > > Thanks, > Ryan > ---- > Ryan Davis > Director of Programming Services > http://www.acceleration.net/ > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
