You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Gary Mangum <Ga...@Coresoft.com> on 2000/10/05 22:48:32 UTC
Why use velocity instead of XML and XSL to handle separation of c
ontent???
I'm just learning about velocity, so I am trying to compare the velocity
project with research that I have done into using XML and XSLT. I've also
looked into the possibility of using Cocoon, another apache project, but am
not sure that it offers me what I need.
Why is the velocity project setting up it's own parser and template
language, instead of using the existing parser and template language found
in XML and XSL??? It seems like what you are building is almost an exact
match to what is already existant in XML and XSL, and they seem like the
better choice since they are standardized. Your Context object matches
information that would be incuded in XML, and your Template file matches
functionality existant in XSL.
Thanks for your help.
Gary
Re: Why use velocity instead of XML and XSL to handle separation of
content???
Posted by Leon Messerschmidt <le...@opticode.co.za>.
> I'm just learning about velocity, so I am trying to compare the velocity
> project with research that I have done into using XML and XSLT. I've also
> looked into the possibility of using Cocoon, another apache project, but
am
> not sure that it offers me what I need.
>
> Why is the velocity project setting up it's own parser and template
> language, instead of using the existing parser and template language found
> in XML and XSL??? It seems like what you are building is almost an exact
> match to what is already existant in XML and XSL, and they seem like the
> better choice since they are standardized. Your Context object matches
> information that would be incuded in XML, and your Template file matches
> functionality existant in XSL.
>
I love XML/XSL but it is *not* what Velocity does. For example - how would
you enter stuff that you extracted from a database to your page with XSL?
In our company we actually use Velocity and XSL stylesheets in combination!
We use Velocity template to create XML files from templates which is then
transformed with a XSLT to get the right presentation. Basically Velocity
adds dynamic content like database stuff (amongst others) and XSL does the
presentation.
2 Very different tools for 2 very different problem sets.
~ Leon
Re: Why use velocity instead of XML and XSL to handle separation of
content???
Posted by Christoph Reck <Ch...@dlr.de>.
Hi Gary,
the main driving factor for a templating engines is to construct a
clean MVC system. The template beeing the view portion of it.
It is true that newest developments are enclosing more XML
formatted data, but this is not the case with many other business
logic controlled systems (JavaBeans et al) are in the play.
When the input is not XML, it cannot be processed using XSLT.
Cocoon addresses an important area of static (or dynamic - e.g.
from a SQL sources) XML publishing. Cocoons/XSLT main drawback is
the strange language not suitable for web-designers (but only for
experianced developers/programers).
Therefore in the last years/months several implementaions have
emerged dealing with easy to use template formats/languages/engines
to help web designers creating the view portion for a MVC system:
WebMacro, FreeMarker, Cocoon, JSP, and Tea to name a few. Most of
these flavours suit the whole tempalting needs, but differ int
their way of usage, clarity for the diesigner and contain drawbacks.
An article describing the pros and cons of JSP vs other templating
languages can be found at:
http://www.servlets.com/soapbox/problems-jsp.html
see also:
http://www.webmacro.org/
http://jakarta.apache.org/velocity/
http://freemarker.sourceforge.net/
http://opensource.go.com/TeaServlet/
http://xml.apache.org/
http://www.enhydra.org/
Other exchanges on this subject have been posted in the searchable
archive at:
http://www.mail-archive.com/turbine%40list.working-dogs.com/
Velocity is just a reengineered WebMacro, since the latter war
originaly released under GPL which was unacceptable for a
distribution under Apache lincense. Beeing a new design, it
also encloses more flexible architecture and desing (e.g. parser)
but is far yet from beeing complete. Current desings should
therefore concentrate on WebMacro
Hope that this settles your question,
:) Christoph
P.S. when I looked at cocoon some months ago, I dropped the
idea of using it, because of the need of the data (the model)
requiring a <PI> defining the processing and formatting. This
should be solved by coccon2 with the sitemap, but this again
did not enclose a feature of multiple producers or a controller
that accesses the model and defines the required views. I needed
a configurable hierarchy of producers/processors/formatters.
I will use XML/XSLT for the portions where it fits (Xalan.jar)
and WebMacro to provide the front ends for the views (which can
be embedded into other views!). Currently i'm testing in using
WM also as the controller configuration template (otherwise
I would design a propietary XML configuration format to do it
- I have something similar already working for another project).
Turbine (http://java.apache.org/turbine/) will be the framework
for the servlet, parameter parsing, and user-role confguration.
Gary Mangum wrote:
>
> I'm just learning about velocity, so I am trying to compare the velocity
> project with research that I have done into using XML and XSLT. I've also
> looked into the possibility of using Cocoon, another apache project, but
> am not sure that it offers me what I need.
>
> Why is the velocity project setting up it's own parser and template
> language, instead of using the existing parser and template language found
> in XML and XSL??? It seems like what you are building is almost an exact
> match to what is already existant in XML and XSL, and they seem like the
> better choice since they are standardized. Your Context object matches
> information that would be incuded in XML, and your Template file matches
> functionality existant in XSL.
>
> Thanks for your help.
> Gary
Re: Why use velocity instead of XML and XSL to handle separation
of c ontent???
Posted by Jon Stevens <jo...@latchkey.com>.
on 10/5/2000 1:48 PM, "Gary Mangum" <Ga...@Coresoft.com> wrote:
> I'm just learning about velocity, so I am trying to compare the velocity
> project with research that I have done into using XML and XSLT. I've also
> looked into the possibility of using Cocoon, another apache project, but am
> not sure that it offers me what I need.
>
> Why is the velocity project setting up it's own parser and template
> language, instead of using the existing parser and template language found
> in XML and XSL??? It seems like what you are building is almost an exact
> match to what is already existant in XML and XSL, and they seem like the
> better choice since they are standardized. Your Context object matches
> information that would be incuded in XML, and your Template file matches
> functionality existant in XSL.
>
> Thanks for your help.
> Gary
Sigh, because XML and XSL isn't the solution to everything. Just because
something is "standardized" doesn't mean that there is a need for other
things.
For example, Velocity can be used to send dynamic email easily, dynamically
create Java code (see Turbine's torque/newtorque stuff), dynamically create
XML files, and many many many other things.
As for the Context object, that is just a standard mechanism for
transporting information through the MVC layer.
-jon
--
http://scarab.tigris.org/ | http://noodle.tigris.org/
http://java.apache.org/ | http://java.apache.org/turbine/
http://www.working-dogs.com/ | http://jakarta.apache.org/velocity/
http://www.collab.net/ | http://www.sourcexchange.com/