forrest-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vassilis Koutavas" <vassi...@gmail.com>
Subject Re: Generating an aggregated xml from all the files in a directory
Date Sun, 04 Mar 2007 01:00:02 GMT
Thank you both very much! I would've never discovered how this works by myself.

As it turned out I had to do a combination of both your answers and a
liitle experimentation to make things work. For future reference
here's what I had to do:

Add in sitemap.xmap  *two* things:
  (a) a new generator componet:

  <map:components>
    <map:generators>
      <map:generator name="sxw" label="content" logger="sitemap.generator.sxw"
        src="org.apache.forrest.generation.SXWGenerator"/>
      <map:generator name="xpathdirectory"
src="org.apache.cocoon.generation.XPathDirectoryGenerator" />
      <map:generator name="directory"
src="org.apache.cocoon.generation.DirectoryGenerator"/>
    </map:generators>
  ...

 (b) A new match-pattern (how are these things called anyway?) in the
standard pipeline.

    <map:match pattern="**buildings/building-table.xml">
      <map:generate type="xpathdirectory"
                    src="{project:content.xdocs}{1}buildings">
        <map:parameter name="xpath" value="/building"/>
        <map:parameter name="include" value="\.*-bld.xml$"/>
      </map:generate>
      <map:transform
src="{project:resources.stylesheets}/buildingtable2document.xsl" />
      <map:serialize type="xml"/>
    </map:match>

  Here I used the xpathdirectory, proposed by Evangelos, because the
directory generator used in the resume example was not selecting any
node. I still don't understand which is the root element of the
aggregation and I don't know how to debug in forrest to find out. I
just matched the root element with "/" in the xsl.

I also added the above in the sitemap.xmap, instead of the input.xml,
because I don't find any reason why the input.xmap file needs to
exist. Maybe it has a reason if you speak about seperate modules and
plugins, but none for a single project.

Another point in the resume example that I had to change is the value
of the "src" field of the xpathdirectory generator from

{property:content.xdocs}{1}buildings

to

{project:content.xdocs}{1}buildings

I think the resume example needs to be corrected there, unless there
is something different in the cvs version of forrest.

Thanks again for your help, and I wish in the future there will be a
*real* reference document for forrest and cocoon. (See Java's API
reference to see how I think it should look like.)

--Vassilis



On 3/3/07, Ross Gardler <rgardler@apache.org> wrote:
> Ross Gardler wrote:
> > Vassilis Koutavas wrote:
> >> What is the right way to create one aggregated xml file from all the
> >> xml files in a directory?
> >
> > Take a look at the resume input plugin in the whiteboard in SVN head [1]
>
> Sorry forgot the URL
>
> [1]
> http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.Resume/input.xmap?revision=431247&view=markup
>
> Ross
>


-- 
Vassilis

Mime
View raw message