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

Daniel López <[email protected]>
Newsgroups gmane.comp.web.freemarker.user
Message-ID <[email protected]>
Hi Thierry,

Try using <#ftl strip_whitespace="true"> at the beginning of your 
template. At least that's what I use on my 
templates-that-process-XML-and-produce-JSON, which is also kind of picky 
with the newlines and spaces.

S!
D.

thierry henrio escribió:
> Hi all
> I need to render something like
> 
> data=
> <bill>
>     <material>eggs</material>
>     <material>milk</material>
> </bill>
> 
> as
> output=
> "eggs,milk"
> 
> at first, I though : "hey that does not look so difficult !!, that will 
> be a matter of minutes" ...
> so I wrote a learning test : 2 minutes
> now, I must admit my learning test is still red after 2 hours :(
> 
> so, is there anyone kind enough to teach me how to achieve this ??
> 
> note 1:
> i rapidly produced the following output
> "eggs,
> milk
> "
> 
> with template=
> <#assign x>
> <#list bill.material as x>
> ${x}<#if x_has_next>,</#if>
> </#list>
> </#assign>
> ${x}
> 
> but these \n are killing my test !!
> 
> note 2:
> I'm angry to have to render in the xml output document something like that
> <property name="badDesignedDataModel" value="value1, value2, value3"/>
> where valueX are identified items in my xml data document
> but that is it :)
> 
> Regards, Thierry
> 
> 
> ------------------------------------------------------------------------
> 
> -------------------------------------------------------------------------
> 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


-- 
-------------------------------------------
Daniel Lopez Janariz ([email protected])
Web Services
Centre for Information and Technology
Balearic Islands University
(SPAIN)
-------------------------------------------

-------------------------------------------------------------------------
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
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.