[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Template Facet (was Re: Template Constructs)




Robert Sayre wrote:


A GET to http://example.net/templates/1 would return a template construct [1]. Assuming vnd.joe.templatelanguage was a language that used double-brace delimiters, it might return something like this:

<template mode="escaped" type="application/vnd.joe.templatelanguage">
&lt;h1&gt; {{BlogTitle}}  &lt;/h1&gt;
&lt;h2&gt; {{EntryTitle}} &lt;/h2&gt;
&lt;p&gt; {{EntryBody}} &lt;/p&gt;
</template>


This is where my approach diverges:


I'm proposing that a response to a GET looks like this:

HTTP/1.1 200 OK
Content-Type: application/vnd.joe.templatelanguage

...vendor specific bits...

That makes a lot more sense to me. There's no reason to limit the content of templates to something that can be expressed inside an XML document. It's certainly feasable for some tool to require templates in some binary format that doesn't play well with XML, why require them to jump through hoops to escape it?


-garrett