Re: Naming advice for a templating module
* Dr Bean [EMAIL PROTECTED] [2006-03-04 09:00]: On Fri, 03 Mar 2006, A. Pagaltzis wrote: I had been thinking of XML::SlickTemplate. :-) Or else I might go with XML::SimpleTemplate. They seem only a little less brand-namey than Xmplate, which I thought was a nice play on words at the time. They’re better than Xmplate in that they actually contain the word “Template,” but they’re not very descriptive, no. I’m not satisfied, but I’m still failing to come up with a truly satisfactory name. :-/ Regards, -- Aristotle Pagaltzis // http://plasmasturm.org/
Re: Naming advice for a templating module
On Sat, 04 Mar 2006, A. Pagaltzis wrote: * Dr Bean [EMAIL PROTECTED] [2006-03-04 09:00]: On Fri, 03 Mar 2006, A. Pagaltzis wrote: I had been thinking of XML::SlickTemplate. :-) Or else I might go with XML::SimpleTemplate. They’re better than Xmplate in that they actually contain the word “Template,” but they’re not very descriptive, no. I’m not satisfied, but I’m still failing to come up with a truly satisfactory name. :-/ What about Template::XML? Except that it might be thought to be part of Template Toolkit. -- Dr Bean
Re: Naming advice for a templating module
A. Pagaltzis writes: * Dr Bean [EMAIL PROTECTED] [2006-03-04 10:05]: What about Template::XML? Except that it might be thought to be part of Template Toolkit. Yeah, the Template:: TLNS is nominally reserved for the Template Toolkit like DBI:: is for the DBI, even though some people have put other modules in those namespaces. The difference is that DBI is a branded-type name, in that it didn't have any meaning as a word until the DBI module were created, so it's reasonable that it takes a namespace to itself. Whereas template is an ordinary generic English word which is useful to many modules, so it isn't as reasonable for one particular templating module to snaffle that entire top-level namespace from everybody else. Smylers
Re: Naming advice for a templating module
On Fri, 03 Mar 2006, A. Pagaltzis wrote: I had been thinking of XML::SlickTemplate. :-) Or else I might go with XML::SimpleTemplate. They seem only a little less brand-namey than Xmplate, which I thought was a nice play on words at the time. Perhaps camel case appears brand-namey to me, as it was for a time. -- Dr Bean
Re: Naming advice for a templating module
* David Golden [EMAIL PROTECTED] [2006-02-28 05:15]: Hmm. In pondering words for what you described as idiomatic or perlish, your comment make me wonder if XML::Sketch might capture the flavor of it? Or perhaps XML::DWIM? Those are too close to branded names. :-/ I definitely want “Template” somewhere in there. Nothing about it is DWIMmish either, everything is quite explicit. Another way to approach it: if you golfed a module abstract for it as short as you could, what would it say? Hmm. It would be something like XML templating with lean syntax and embedded Perl or very close to it. Regards, -- #Aristotle *AUTOLOAD=*_;sub _{s/(.*)::(.*)/print$2,(,$\/, )[defined wantarray]/e;$1}; Just-another-Perl-hacker;
Re: Naming advice for a templating module
On 2/28/06, A. Pagaltzis [EMAIL PROTECTED] wrote: Hmm. It would be something likeXML templating with lean syntax and embedded PerlA, just give us 2 or 3 samples of how it works... living breathing code. And then the name for it will manifest almost at once.
Re: Naming advice for a templating module
* Lincoln A. Baxter [EMAIL PROTECTED] [2006-02-26 05:00]: Also, if anything, it would have to be XML::StrictTemplate, since XML::Template::Strict sounds like it has some sort of commonality with XML::Template, of which there is absolutely none. Now that I like better. it conveys a real distinction, and tells me something. The problem is that the distinction is really hard to put in a single word. How do you express “templatish, Perlish and XMLish?” Maybe I should give up and just try to generically differentiate from XML::Template, like maybe XML::ExTemplate? If you are going in that direction... why not just XML::XTemplate or XML::xTemplate or XML::nTemplate (n=new) I was thinking ::SlickTemplate. Now that I think about it... why not post a pod so we can see what the interface might look like. I don’t have anything like that yet. I’m still in the sketching phase, the code is only half-written, etc. As I said, I might end up never uploading this at all. Are you depending on one of the XML parser modules? Yes, XML::LibXML, but I don’t think that’s a useful distinction for naming the module, if that was your tack. Regards, -- Aristotle Pagaltzis // http://plasmasturm.org/
Re: Naming advice for a templating module
Hi Sébastien, * Sébastien Aperghis-Tramoni [EMAIL PROTECTED] [2006-02-26 23:25]: Maybe I miss something, but did you look at AxKit? http://www.axkit.org/ I've never used it but I've always heard about it as *the* Perl-XML web framework. yes, I’ve seen AxKit and used it. It’s nice, but I’m looking for a template language, not a framework. AxKit gives you chains of XSLT and XPathScript and the like, which is all very well if you have XML documents to begin with, but it doesn’t particularly help when you start with data structures and want to make XML documents from them. Regards, -- Aristotle Pagaltzis // http://plasmasturm.org/
Re: Naming advice for a templating module
Hi Terrence, * Terrence Brannon [EMAIL PROTECTED] [2006-02-26 04:25]: Can you give some usage examples of your approach to XML templating? I'm curious to see what you need that XML::DOM, XML::LibXML, XML::LibXSLT, and PeTaL and XML::Twig cannot do for you. errm… you’re not seriously suggesting I use the DOM API to build documents, are you? I can imagine a lot of things more fun than that, like stabbing my eyeball with a fork f.ex. Twig is much better, but still they’re not *templates*. I want to write *templates*, not code that builds the document programmatically, however easy the API for that might be. Is there any reason you are proposing both modules in the same breath anyway? XML::LibXML can do all of what XML::DOM can and is superior in every way. Using XSLT is well and fine if you have an XML document to begin with, but when you have data structure to start with, it’s no help at all. Now Petal… is very, very very close. The basic idea is virtually identical, which is no wonder, because what I’m doing is a port of Kid[1], which is inspired by TAL. (Not a straight port; this is supposed to be as perlish as Kid is pythonic.) The most visible difference in terms of syntax is that TAL/Petal has this hackneyed minilanguage; I want Perl. But there are a lot more differences. The code-side API is very different from that of Petal, with templates mapping directly to classes and all the voodoo in place so that you just `use` or `require` them as if they were Perl modules. Template expansion is streaming. The template compiler is also much simpler than the one in Petal because all I’m doing is mapping from SAX events to code snippets during parsing. [1] http://kid.lesscode.org/ Regards, -- Aristotle Pagaltzis // http://plasmasturm.org/
Re: Naming advice for a templating module
On 2/27/06, A. Pagaltzis [EMAIL PROTECTED] wrote: Twig is muchbetter, but still they're not *templates*. I want to write*templates*, not code that builds the document programmatically,however easy the API for that might be.I see. I'm not a fan of the concept of templating. Templating is not my cup of tea. I don't understand what excites people about that approach. But it is popular and pervsasive. I'm all about separation of data and the strategy for its manipulation. But that's just me. Now Petal… is very, very very close. The basic idea is virtuallyidentical, which is no wonder, because what I'm doing is a port of Kid[1], which is inspired by TAL. (Not a straight port; thisis supposed to be as perlish as Kid is pythonic.). Template expansion is streaming. It sounds like the pre-compilation and caching of templates won't be a part of your system? Perhaps this is not necessary and should be offloaded to other things anyway.Here is a cute way to do streaming template expansion for Perl and HTML:http://homepage.mac.com/pauljlucas/software/html_tree/ It was a neat idea at the time... the very very first versions of HTML::Seamstress basically expanded his idea and dropped in CPAN modules like Data::DRef for dot-notation instead of homegrowing everything. Thetemplate compiler is also much simpler than the one in Petalbecause all I'm doing is mapping from SAX events to code snippets during parsing.Is this thing written? Can we try it out? [1] http://kid.lesscode.org/I went and looked at that... again, I don't understand people who are into that sort of thing, so either me or the templating people are from a different galaxy or something :)
Re: Naming advice for a templating module
* Terrence Brannon [EMAIL PROTECTED] [2006-02-27 19:55]: I don't understand what excites people about that approach. Writing the output directly in its final form instead of writing code that generates that output. In my experience, output tends to be 97% static stuff, 2.5% very simple logic, and 0.5% really hairy data munging. I don’t want to write code to output those 97% static strings. I just want to write them down and be done. (Likewise, I don’t want to wrestle a crippled mini language for those hairy 0.5%. I just want to use Perl and be done.) It sounds like the pre-compilation and caching of templates won't be a part of your system? Caching, no, compilation, yes. As I said, templates will behave just like classes written in Perl. Here is a cute way to do streaming template expansion for Perl and HTML: http://homepage.mac.com/pauljlucas/software/html_tree/ Yeah, I saw that long ago. Quite a similar approach to TAL/Petal, Kid, my Kid port, and doubtless many others, in terms of template syntax. I know nothing about how it generates output, though. Is this thing written? Can we try it out? Partially; and, not yet. Regards, -- Aristotle Pagaltzis // http://plasmasturm.org/
Re: Naming advice for a templating module
A. Pagaltzis wrote: I don’t have anything like that yet. I’m still in the sketching phase, the code is only half-written, etc. As I said, I might end up never uploading this at all. Hmm. In pondering words for what you described as idiomatic or perlish, your comment make me wonder if XML::Sketch might capture the flavor of it? Or perhaps XML::DWIM? Another way to approach it: if you golfed a module abstract for it as short as you could, what would it say? Regards, David Golden
Re: Naming advice for a templating module
A. Pagaltzis wrote: Hi all, Hello Aristotle, yes, yes, a templating module. Shush. This one differs because it’s a pure-XML approach. The templates must be well-formed XML, and the design of the template language is built to ensure, as best as possible, that the output is well-formed at all times as well. Maybe I miss something, but did you look at AxKit? http://www.axkit.org/ I've never used it but I've always heard about it as *the* Perl-XML web framework. Sébastien Aperghis-Tramoni -- - --- -- - -- - --- -- - --- -- - --[ http://maddingue.org ] Close the world, txEn eht nepO
Naming advice for a templating module
Hi all, yes, yes, a templating module. Shush. This one differs because it’s a pure-XML approach. The templates must be well-formed XML, and the design of the template language is built to ensure, as best as possible, that the output is well-formed at all times as well. Much to my dismay, the obvious XML::Template choice is taken; particularly to my dismay, that module there follows a really terrible design that I find impossible to use. (That was one of the reasons I set out to write another templating module at all.) The design of mine is very much like Text::Template in a lot of ways, if you disregard the strong XML slant. So now I’ve got to come up with a name. It’s going to be a variation on XML::Template, obviously. The differentiating point that the name should convey is that the templating language is designed to be both more Perlish and more XMLish than that of XML::Template. (Another criterion is that I must not feel silly whenever I mention being the author of that module. :^) ) I briefly considered XML::Template::Native, but in retrospect, that is rather vacuous (and would likely fail the silliness criterion in the long term). It may also be confused as having to do with XML::Template, so I believe it’s better to aim for a name of the form XML::FooTemplate. Anyone have suggestions? TIA, -- #Aristotle *AUTOLOAD=*_;sub _{s/(.*)::(.*)/print$2,(,$\/, )[defined wantarray]/e;$1}; Just-another-Perl-hacker;
Re: Naming advice for a templating module
Hi Lincoln, * Lincoln A. Baxter [EMAIL PROTECTED] [2006-02-25 23:30]: Usually superior designs can be used to wrap infrerior ones in a way that provide backwards compatibility... If the problem is a data file format one, then you could perhaps detect the older format, and drop down to the older routines... I disagree. Perl is not a wrapper around awk+sed+shell. Have you thought about asking the author of the XML::Template, to give it over to you? That would be pointless. I have no interesting in supporting the approach that XML::Template takes, and the one I want to follow doesn’t lend itself to that at all. BTW: I don't really like XML::XMLTemplate... *What* about it do you dislike? Any objective reason, or is it just a matter of taste? Regards, -- Aristotle Pagaltzis // http://plasmasturm.org/
Re: Naming advice for a templating module
On Sun, Feb 26, 2006 at 12:22:55AM +0100, A. Pagaltzis wrote: BTW: I don't really like XML::XMLTemplate... *What* about it do you dislike? Any objective reason, or is it just a matter of taste? I don't like the repetition. Repeating XML adds no value to the name for me. Why not go shopping among the many HTML::Template variations? I'll suggest XML::Template::Strict, since your approach seems to be stricter about validness than XML::Template. Mark
Re: Naming advice for a templating module
* Mark Stosberg [EMAIL PROTECTED] [2006-02-26 01:40]: I don't like the repetition. Repeating XML adds no value to the name for me. Well, taken versus the XML::Template approach, it makes some amount of sense. With XML::Template you don’t actually write templates so much as grammars and instances of them; with my module, you write an template XML file. I'll suggest XML::Template::Strict, since your approach seems to be stricter about validness than XML::Template. Careful: well-formed != valid. I don’t do anything about validation; in terms of well-formedness, XML::Template is even stricter than the approach I’m following. I expect that my module will be capable of producing malformed markup if you try to coerce it hard enough – just not in any common scenario. Also, if anything, it would have to be XML::StrictTemplate, since XML::Template::Strict sounds like it has some sort of commonality with XML::Template, of which there is absolutely none. Any way to express “idiomatic” in a short word that’s suitable for a descriptive name? Maybe I should give up and just try to generically differentiate from XML::Template, like maybe XML::ExTemplate? Regards, -- Aristotle Pagaltzis // http://plasmasturm.org/
Re: Naming advice for a templating module
Can you give some usage examples of your approach to XML templating? I'm curious to see what you need that XML::DOM, XML::LibXML, XML::LibXSLT, and PeTaL and XML::Twig cannot do for you.-- http://slowchess.com/ http://www.moneycoop.org http://www.osogd.org http://www.metaperl.com http://www.livingcosmos.org