Return-Path: Delivered-To: apmail-jakarta-velocity-user-archive@www.apache.org Received: (qmail 34845 invoked from network); 4 Dec 2004 05:14:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 4 Dec 2004 05:14:07 -0000 Received: (qmail 22939 invoked by uid 500); 4 Dec 2004 05:14:05 -0000 Delivered-To: apmail-jakarta-velocity-user-archive@jakarta.apache.org Received: (qmail 22801 invoked by uid 500); 4 Dec 2004 05:14:04 -0000 Mailing-List: contact velocity-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Velocity Users List" Reply-To: "Velocity Users List" Delivered-To: mailing list velocity-user@jakarta.apache.org Received: (qmail 22787 invoked by uid 99); 4 Dec 2004 05:14:04 -0000 X-ASF-Spam-Status: No, hits=1.5 required=10.0 tests=DNS_FROM_RFC_POST,MSGID_FROM_MTA_HEADER,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of donsubbu@hotmail.com designates 64.4.35.177 as permitted sender) Received: from bay12-dav3.bay12.hotmail.com (HELO hotmail.com) (64.4.35.177) by apache.org (qpsmtpd/0.28) with ESMTP; Fri, 03 Dec 2004 21:14:02 -0800 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Fri, 3 Dec 2004 21:14:00 -0800 Message-ID: Received: from 129.110.90.41 by BAY12-DAV3.phx.gbl with DAV; Sat, 04 Dec 2004 05:13:28 +0000 X-Originating-IP: [129.110.90.41] X-Originating-Email: [donsubbu@hotmail.com] X-Sender: donsubbu@hotmail.com Reply-To: From: "Subbiah" To: "'Velocity Users List'" Subject: RE: XML and velocity Date: Fri, 3 Dec 2004 23:13:27 -0600 MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook, Build 11.0.6353 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 In-Reply-To: <20041203135339.B51F.SHINOBU.KAWAI@gmail.com> Thread-Index: AcTY9MJ/OO+R14CvSdeMyjePQY9n/gAyqk+g X-OriginalArrivalTime: 04 Dec 2004 05:14:00.0547 (UTC) FILETIME=[1068D330:01C4D9C0] X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N >If you put the DOM document itself in the Context, > the template designers will have to know how to use DOM. But > if you extract all the data needed in java, and put them in > the Context in a more user-friendly fashion I see your convincing point here. Thank you. In my particluar hase I though abt creating an obejct and sending it to the context but the XML was generated from an object suing castor at some other point in the app and I did not want to convert it into an object again. What is the best way of solving such a problem. I wanted to use Xpath style references in my velocity but could not get it to work Any directions here. Thanks for your replies though !!! > -----Original Message----- > From: Shinobu Kawai [mailto:shinobu.kawai@gmail.com] > Sent: Thursday, December 02, 2004 11:02 PM > To: Velocity Users List > Subject: Re: XML and velocity > > > Hi Subbiah, > > > My generic question on VELOCITY is this. > > 1. I see velocity very similar to adding sessions in servlets and > > accessing them in the jsp pages. Is this correct ? > > In a way, yes. In Velocity, you put stuff in the Context, > and then you can access them from the template. In addition > to that you have access to some easy-to-use directives. :) > http://jakarta.apache.org/velocity/user-guide.html#Directives > > > 2. I am using VELOCITY to generate templates for certain > messages that > > will be filled at run time. The input is XML and output is > any file. > > We use velocity because, the client can change the template anytime > > his fomat changes, but after using velocity [I might be > wrong] I feel > > he still has to know the details of the object or java > classes to use > > velocity , for example I use DOM parser, then the client > has to know > > what methods are there to make a change in the > template.This is like > > changing the source code of the generator one thing he need > do is rebuild. > > > > Is this the advantage that velocity provides or are that > more that my > > short sightedness prevenst me from seeing [I am sure there are] > > VTL itself is a very simple language. The problem here is > that you aren't being friendly to the template designers (the > client). If you put the DOM document itself in the Context, > the template designers will have to know how to use DOM. But > if you extract all the data needed in java, and put them in > the Context in a more user-friendly fashion (like custom > JavaBeans), the only things the template designers need to > know are the reference names of the information plus maybe > some custom methods for doing special things. > > Good luck with Velocity! ;) > > Best regards, > -- Shinobu Kawai > > -- > Shinobu Kawai > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: velocity-user-help@jakarta.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: velocity-user-help@jakarta.apache.org