You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by Gary Zuo <gx...@yahoo.com> on 2002/07/17 05:03:09 UTC

Velocity is more verbose than XSLT

$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.


__________________________________________________
Do You Yahoo!?
Yahoo! Autos - Get free new car price quotes
http://autos.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Velocity is more verbose than XSLT

Posted by Attila Szegedi <sz...@freemail.hu>.
$ root.selectNodes("/properties/author/email/text()")

Is this compact enough?

--
Attila Szegedi
home: http://www.szegedi.org


----- Original Message -----
From: "Gary Zuo" <gx...@yahoo.com>
To: <ve...@jakarta.apache.org>
Sent: 2002. jĂșlius 17. 5:03
Subject: Velocity is more verbose than XSLT


>
$root.getRootElement().getChild("properties").getChild("author").getChild("e
ma
> 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.
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Autos - Get free new car price quotes
> http://autos.yahoo.com
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Velocity is more verbose than XSLT

Posted by Jon Scott Stevens <jo...@latchkey.com>.
on 7/16/02 8:57 PM, "Gary Zuo" <gx...@yahoo.com> wrote:

> I looked into
> Anakia, Texen and then stopped.
> 
> Gary

DVSL is the right way to go, but please note that Anakia supports Xpath as
well...

-jon


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Velocity is more verbose than XSLT

Posted by Gary Zuo <gx...@yahoo.com>.
Thanks for the pointer.  Looks like DVSL is what I want. 
There're so many Velocity subprojects.  I looked into
Anakia, Texen and then stopped.

Gary


--- "Geir Magnusson Jr." <ge...@adeptra.com> wrote:
> On 7/16/02 11:03 PM, "Gary Zuo" <gx...@yahoo.com> 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...)
> 



__________________________________________________
Do You Yahoo!?
Yahoo! Autos - Get free new car price quotes
http://autos.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Velocity is more verbose than XSLT

Posted by "Geir Magnusson Jr." <ge...@adeptra.com>.
On 7/16/02 11:03 PM, "Gary Zuo" <gx...@yahoo.com> 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.
geirm@adeptra.com
+1-203-247-1713



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>