On 12 май, 17:08, Nic James Ferrier <[EMAIL PROTECTED]> wrote: > Eugene Morozov <[EMAIL PROTECTED]> writes: > > Sorry, I don't get the point. I think that XSLT is a way to separate > > presentation from data. But your json looks like some kind of HTML. I > > don't understand how this is better than existing Django templates. > > It has several advantages: > > - there is proper separation between data and style, my JSON doesn't > include any stylistic information, only stuff that describes the data
I still think that your example is not the best. "div" and "span" has no semantic meaning, they're just HTML placeholders. > - the JSON template *is* python, you can pretty much do anything with > it: you can separate bits of the rendering with different methods, > you can test it outside of Django, you can pass it around and > process it with Python quite naturally. This is valid point. > > - you get JSON output if you want it, direct from your view This is valid point, too. > - you get to use XSLT to turn the JSON into anything you want... you > need Atom from a resource as well as HTML? Just have 2 different > stylesheets but the same JSON. I think it is possible with plain Django templates, too. Just define 2 different templates. Your small framework could be really useful in some situations, I was just thinking about how to apply my XSLT knowledge to ease web development tasks. But I think that need better examples really showing benefits of XSLT approach. I was turned off by those HTML elements in JSON data immediately. Maybe this is just my personal opinion. Eugene --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---