Am 28.11.2013 um 10:37 schrieb Tudor Girba <tudor@tudorgirba.com>:

Hmm. What exactly does it mean to build XML/JSON responses out of the template?

It is the same as for any other template, too. You have a prepared document at hand where you can replace the placeholders with real values. Doing this for a structured response is surely not a good idea. Generating the response in a structured way is more reliable and has less potential for the usual traps.
But there is a threshold when the complexity of the response structure is far bigger then the needed diversity of requests/responses. In those cases building a structure that can properly generate a request or response if you only need a simple things would be overkill. 
I generate SOAP requests. SOAP is utterly complex and the ratio of gain/complexity is really really small. The API we have to deal with is complex, too. And we need only a handful calls from the whole API. So I hope you can see that there are reasons to take a less clever approach. And it is a approach I can do with pharo ;)

Norbert

On Thu, Nov 28, 2013 at 8:13 AM, Norbert Hartl <norbert@hartl.name> wrote:


Am 28.11.2013 um 00:21 schrieb "Esteban A. Maringolo" <emaringolo@gmail.com>:

Did you try to build JSON responses with this templating solution?

No, I didn't. Only xml so far.
Norbert

Regards!

Esteban A. Maringolo


2013/11/27 Norbert Hartl <norbert@hartl.name>

Am 27.11.2013 um 14:03 schrieb Damien Cassou <damien.cassou@gmail.com>:

> On Wed, Nov 27, 2013 at 1:42 PM, Norbert Hartl <norbert@hartl.name> wrote:
>> Be my guest
>>
>> http://norbert.hartl.name/blog/2013/10/03/mustache-templates-for-smalltalk/
>
>
> thank you Norbert, that's really useful.
>
I would be glad if you would use it. If the additional emitted whitespaces are annoying to you drop me a note. I now postpone the implementation of the whitespace for too long anyway.

Norbert






--
www.tudorgirba.com

"Every thing has its own flow"