velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Koberg <...@koberg.com>
Subject Re: The Guardian website moves to Velocity
Date Fri, 11 May 2007 17:16:17 GMT
On Fri, 2007-05-11 at 18:26 +0200, Jonathan Revusky wrote:
> Robert Koberg wrote:
> THe templates generated may be simpler, but the overall architecture, a 
> pipeline of XML->XSLT->VTL->final output is, it seems to me, quite 
> complex. (Maybe it doesn't seem that way to you, but that would probably 
> be because you're used to it...)

I don't 'pipeline' quite that way although that is the sequence, I
suppose. The pages/templates are pregenerated in our CMS (not all or
most need to be dynamic at runtime). It doesn't matter what/where the
runtime is. I have had a preference for Velocity because when I was
looking for an XML friendly templating syntax in the java world, it was
limited to Velocity. Maybe someday someone will want our XSL to output
FreeMarker, just hasn't happened yet.


> > It would be hard for the interface
> > type devs to see these in your docs and mentally switch to the XML
> > syntax, I think. Since I use XSL/XML, it is difficult to transform out
> > to a non well-formed result.
> 
> Well, the alternative syntax makes this point moot, but the other deeper 
> point, I think, is that, once you're using FreeMarker, there isn't that 
> much reason to use this pipeline of generating a template with XSLT. You 
> could do everything with FreeMarker, since it is a very powerful XML 
> transformation tool in its own right. See:
> 
> http://freemarker.sourceforge.net/docs/xgui_declarative_basics.html

First, you use a W3 DOM which is very expensive/inefficient. XSL
processors create a processor optimized DOM. For example saxon creates
something like a List of SAX events. Second, XSL v1 is pretty mature and
the processors are very good. There are processors for Java, .NET, C,
Eiffel, and probably others that can use the exact same XSL. My same XSL
that usually ran on the server can now effectively run on the client
(for a 'preview' type of thing) for reduced server load. Third, I have
come to rely on a great deal of the W3 XSL spec, I would hate to switch
to something does not implement it all. Fourth, I have not gone up to
XSL v2 yet (mainely because of browser rendering), but it wouold be
relatively painless. Whereas switching to FreeMarker would require *A
LOT* of work and most likely a lot of feature requests... anyhoo, don't
want to get off-topic :)

> 
> Likely, you could replace your:
> 
> XML->XSLT->VTL->final output
> 
> to just:
> 
> XML->FTL->final output.
> 
> And that truly would be simpler, I'd say. Of course, I told you this 
> before, and you weren't interested for whatever reason.

And I told you before, we pregenerate the pages. Think of it like a cache, kinda.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org


Mime
View raw message