Hi guys, check out this template engine, it's a fairly cool, entirely
xml attribute based. https://axt.dev.java.net/ . I happen to know the
guy who came up with it and have used it several times for XML. Quite
nifty, works great with XML editors and the result is always well formed.
Cheers,
j.
Will Glass-Husain wrote:
Ok, I take it back. I thought you were just discussing FreeMarker but
you're
right - it's kind of an interesting general question. (Can we change
the subject tag please).
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).
There's really three issues I've found.
One is formatting text within a tag. Most editors work fine with this.
<Data>A $reference goes here#if($condition)$another#end</Data>
Second is showing or hiding complete tags. Some editors work with this
(XMLBuddy does acceptably), others choke.
#if($condition) <Data>dkfjadskfjadks</Data>#end
And the third is hiding/showing attributes
<Data #if($condition)$att="test"/>
Most editors fail on this. Sometimes they'll do ok with this instead.
#set($att = "att = 'abc'")
<Data $att />
Anyone have other experiences?
WILL
----- Original Message ----- From: "Robert Koberg" <[EMAIL PROTECTED]>
To: "Velocity Developers List" <[email protected]>
Sent: Wednesday, August 24, 2005 6:30 PM
Subject: Re: wanting to join the team
Will Glass-Husain wrote:
Can you take the FreeMarker question to the FreeMarker lists?
Jonathan - is there a archive those of us interested can follow? (I
have
the XML issue as well from time to time)
I don't see why a comparison or this discussion is off-topic.
-Rob
Thanks,
WILL
----- Original Message ----- From: "Robert Koberg" <[EMAIL PROTECTED]>
To: "Velocity Developers List" <[email protected]>
Sent: Wednesday, August 24, 2005 6:21 PM
Subject: Re: wanting to join the team
Jonathan Revusky wrote:
I've heard this before. I think you must mean that FreeMarker's
syntax -- the use of <#...> as delimiters -- confuses XML-oriented
editors.
It does not confuse them. It is just wrong for XML. Or are you saying
freemarker understands things it was not specified to handle?
Because, of course, generally, the claim is not valid: there's no
general need for a template to be well formed in its output
format. For
example, it would be surprising if a raw template used to generate
Java
code was itself compilable java.If you're generating XML, the key
thing
is that the output be well formed XML and a lots of people use it for
that.
Well, I use Velocity in content chunks that are transformed by XSL to
whatever end result. I need the source to be well-formed.
But, anyway, FYI that was just addressed. You can now use an
alternative syntax where instead of:
<#assign x = 3>
you write
[#assign x=3]
OK. I guess I would trust velocity at this point.
etcetera. So it's now just as XML-friendly as Velocity is. Though,
with
the difference that FM is a powerful XML transformation tool and a
viable replacement for XSLT.
Is freemarker a standard (sorry, I know the answer :)? Does freemarker
have as many/more implementations as there are XSLT processors? I
highly
doubt freemarker has run into the cases that the more established XSL
processors have.
-Rob
Jonathan Revusky
---------------------------------------------------------------------