On 7/16/02 11:03 PM, "Gary Zuo" <[EMAIL PROTECTED]> wrote:

> $root.getRootElement().getChild("properties").getChild("author").getChild("ema
> il").getText()
> 
> /properties/author/email
> 
> 
> I've always been bothered by XSLT's verboseness.  And as
> such, I have been looking forward to Velocity as a
> alternative.  Obviously, I'm greatly disappointed.
> 

Well, I *almost* don't know what to say, other than you are comparing apples
and oranges.  Velocity is a general purpose template engine for producing
more than just XML otuput (ok, you can do more than XML with XSLT, but it's
really not pleasant...)

First, if you want to compare something that's XSLT-like in pattern, look at
DVSL.  It uses velocity, but lets to get at things in the XML document with
a shorthand reference notation.

Second, your example above is using JDOM for the object model.  There are
alternatives, such as a class I threw somewhere (whiteboard?  Contrib?)
called "XMLEasyBean"

Which lets you do things like

$doc.properties.author.email

Does that help?

-- 
Geir Magnusson Jr. 
Research & Development, Adeptra Inc.
[EMAIL PROTECTED]
+1-203-247-1713



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

Reply via email to