Re: Multiple output files with multiple data

"Daniel Dekany (temporary acc!)" <[email protected]> Tue, 14 Oct 2003 13:04:56 +0200
Newsgroups gmane.comp.text.fmpp
Message-ID <[email protected]>
Tuesday, October 14, 2003, 11:32:22 AM, Leonardo Francalanci wrote:

> I have to create different output files based 
> on the same source file but, differently 
> from the Step 4 on the quick tour, what 
> changes is that I have multiple data sources 
> (multiple xml files).
> Each xml file has the same schema.
> How can I get different outputs from different data sources?

It can be viewed as the same as qtour_step4, just the data physically
splits into multiple files. So, in the <#list> loop, now you should
iterate over the xml files, instead of the rows of a csv file. It can be
tricky how to do it, though... A possible solution is that you rather
use a single-big XML file, an then iterate over the entries stored in
that, but you do it by including the small XML files into the big XML
file with XML's <!ENTITY ...> stuff. Another solution is to query the
names of the available *.xml files with an user defined FreeMarker
directive (or load the list of files from some other data source), and
then use <@pp.loadData ...> to load an xml file in each loop.

However, the question arises for me, wether in your case (which I don't exactly
know), XML files should act as the source files ("templates", not as data),
and there should be an "XML" processing-mode, that uses an FTL template to render
the XML... something that FMPP does not support yet.

> (I've already posted to the SourceForge.net Web forum: where is
> the best place to ask for informations?)

See the bottom of http://fmpp.sourceforge.net/. I absolutely prefer the
mailing list... especially for longer discussions. However, you should
be subscribed or you will not receive the answers. :( (I will look into
if this can be changed somehow...)

-- 
Best regards,
 Daniel Dekany




-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php