At least the following script does exactly what you request:
<?xml version="1.0" encoding="utf-8" ?>
<jelly xmlns="jelly:core" >
<new var="sections" className="java.util.LinkedList"/>
<new var="sec1" className="java.util.LinkedList"/>
<mute>${sec1.add('sleeping')}
${sec1.add('dreaming')}
${sec1.add('eating')}
${sections.add(sec1)}
<new var="sec2" className="java.util.LinkedList"/>
${sec2.add('working')}
${sec2.add('stressing')}
${sec2.add('firing')}
${sections.add(sec1)}</mute>
<forEach var="section" items="${sections}" trim="false">[GOALS_section]
<forEach var="idea" items="${section}">${idea}
</forEach>
</forEach>
</jelly>
.... except for the fact that it doesn't append to a file.
paul
Le 7 janv. 05, � 14:35, Marc DEXET a �crit :
dion gillard (JIRA) wrote:
[
http://issues.apache.org/jira/browse/JELLY-191?
page=comments#action_57378
]
dion gillard commented on JELLY-191:
------------------------------------
Huh? the file tag can write non-xml data. Just use the
omitXmlDeclaration="true". What about that doesn't work?
Oh yes it writes to flat file, no problem BUT...
I explain, imagine I want to create a POHMCF (Plain Old Hand Made
Config
File) like
--------------
[GOALS_section_0]
sleeping
eating
dreaming
[GOALS_section_2]
working
stressing
firing
--------------
with a jelly template
<forEach var="section" items="${sectionList}">
[GOALS_section${section.id}]
<forEach var="idea" items="${section.ideas}">
${idea}
</forEach>
</forEach>
You can't use core file tag, because of it generates
------------------
[GOALS_section_0]sleepingeatingdreaming[GOALS_section_2]workingstressin
gfiri
ng
-------------------
So.
The big work doesn't seem to be about core FileTag, it is around
XMLOutput
and/or Writer used to stream out to file.
"flat" property would mean "Hey guy ! Don't miss space, preserve them
!!"
Marc DeXeT
- because of CNRS is fun ! -
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]