Re: (anti)XMLProcessing : how to render a list of node as a comma separated list of their text ?

"thierry henrio" <[email protected]>
Newsgroups gmane.comp.web.freemarker.user
Message-ID <[email protected]>
Greetings, and thank a lot
you all are right

given data
<bill>
    <material>eggs</material>
    <material>milk</material>
 </bill>

and the desired output = "eggs,milk", the following template are ok

template1=
<#list bill.material as x>${x}<#if x_has_next>,</#if></#list>

template2=
<#list bill.material as x>
${x}<#if x_has_next>,</#if><#t>
</#list>

No need for #assign

So you made me learn two great things
- <#t>, that i misunderstood in documentation :(
- one template line + data => "rendered instruction" on this line, so
template1 is able to render a list of instructions one one line :
"eggs,milk"

Regards, Thierry

On Wed, Jun 18, 2008 at 11:54 AM, Daniel Dekany <[email protected]> wrote:

> Tuesday, June 17, 2008, 4:11:05 PM, thierry henrio wrote:
>
> Well if your test fails with correct output then it is the test that
> is bad. But, use <#t> to remove unwanted indentation and line-breaks.
> And that #assign look like redundant.
>
> --
> Best regards,
>  Daniel Dekany
>
>

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php

_______________________________________________
FreeMarker-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freemarker-user
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.