"Will Glass-Husain" <[EMAIL PROTECTED]> writes:

>I've been having the same issue using Velocity to autogenerate XML.  There's
>a benefit to using an XML editor on the template (I'm using the XML buddy
>plugin) since it does autocompletions, etc.  But most editors choke on the
>extra-XML syntax (such as #if's).

Well, one thing that we have to think about is, that Velocity is not
just a "XML-ish" tool. I use Velocity to build free-form documents,
transform CSV lists and do many more things, that are not at all
related to any markup language.

Would it really make sense to have markups for the language?

<html xmlns="http://www.w3.org/1999/xhtml";
      xmlns:velocity="something reasonable">
[...]
<body>
  <velocity:if>some condition here</velocity:/if>
    <velocity:set>a=0</velocity:set>
  <velocity:else/>
    <velocity:set>a=1</velocity:set>
  <velocity:end/>
</body>

</html>

I think we should learn from the painful experiences with
Jelly. Writing a programming language in XML is not only not very
efficient; noone really likes to write programs by hand in XML and
trying to do multi-tag things like #if .. #elif #else #end in any sort
of markup leads to unspeakable horrors.

(There was a nice "letter to the editor" by Ralf Engelschall (ASF
member and author of mod_rewrite) in the 9/2005 issue of the german iX
magazine. It basically stated "XML is fine as long as there are
machines on both sides of a communication. As soon as a human is
involved, XML is not really the best solution". While I don't agree
totally with him, he does have a point. 

The current Velocity syntax is quite readable even in larger
templates.

>Anyone have other experiences?

To be honest: Velocity is such a widely accepted standard, that I'm
happy that most editors are able to deal with Velocity #tags. I have a
plugin for Eclipse and emacs can deal with it. :-)

One of the strong things about Velocity is that we do not have
open-tag .. close-tag constructs like PHP or JSP (shameless plug: see
http://henning.schmiedehausen.org/velocity/Jakarta%20Velocity.pdf,
page 6). Let's keep it that way.

        Regards
                Henning

-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
[EMAIL PROTECTED]        +49 9131 50 654 0   http://www.intermeta.de/

RedHat Certified Engineer -- Jakarta Turbine Development  -- hero for hire
   Linux, Java, perl, Solaris -- Consulting, Training, Development

                      4 - 8 - 15 - 16 - 23 - 42

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to