Return-Path: Mailing-List: contact velocity-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list velocity-user@jakarta.apache.org Delivered-To: moderator for velocity-user@jakarta.apache.org Received: (qmail 48901 invoked from network); 18 Dec 2000 22:36:04 -0000 Received: from bucky-rwcmex.excite.com (HELO bucky.excite.com) (198.3.99.218) by locus.apache.org with SMTP; 18 Dec 2000 22:36:04 -0000 Received: from almond.excite.com ([199.172.148.82]) by bucky.excite.com (InterMail vM.4.01.02.39 201-229-119-122) with ESMTP id <20001218223538.LCYX1254.bucky.excite.com@almond.excite.com> for ; Mon, 18 Dec 2000 14:35:38 -0800 Message-ID: <14300665.977178938636.JavaMail.imail@almond.excite.com> Date: Mon, 18 Dec 2000 14:35:30 -0800 (PST) From: Fedor Karpelevitch Reply-To: To: velocity-user@jakarta.apache.org Subject: RE: Rendering Velocity Templates with Texen Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Excite Inbox X-Sender-Ip: 216.33.233.99 X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N Hi! As far as I understand how escaping currently works in velocity the easiest way to accomplish what you want is to put the content you do not want to parse into separate files and #include them. I agree though that some clean way of escaping references (like CDATA or smth else) would be useful. fedor. On Mon, 18 Dec 2000 16:54:50 -0500, velocity-user@jakarta.apache.org wrote: > > >Also, as always, give examples in case it is a bug so that Geir and > >Jason can fix them. > > What I am trying to achieve is through Torque/Texen to create Velocity > Templates. The Insert.vm Template is referenced through the Control.vm > template and I want to produce in, a corresponding output template; > > > #if($skin) > $!data.setLayoutTemplate($!skin.getLayout()) > $!page.setCss($!skin.getCss()) > #end > > > That was the part I dont want to be processed. If I put them like that in > the Insert.vm template, then it comes out as, nothing (as expected). If > instead I escape the #'s; > > > \#if($skin) > $!data.setLayoutTemplate($!skin.getLayout()) > $!page.setCss($!skin.getCss()) > \#end > > > it comes out as; > > > > #if($skin) > > > #end > > > again as expected. If I escape the $'s and !'s in there; > > > \#if(\$skin) > \$\!data.setLayoutTemplate(\$\!skin.getLayout()) > \$\!page.setCss(\$\!skin.getCss()) > \#end > > > it comes out as; > > > #if(\$skin) > \!data.setLayoutTemplate(\!skin.getLayout()) > \!page.setCss(\!skin.getCss()) > #end > > > If I escape the !'s and not the $'s; > > > \#if($skin) > $\!data.setLayoutTemplate($\!skin.getLayout()) > $\!page.setCss($\!skin.getCss()) > \#end > > > it comes out as; > > > #if($skin) > $\!data.setLayoutTemplate($\!skin.getLayout()) > $\!page.setCss($\!skin.getCss()) > #end > > > I was wondering if there was existing functionality to do something like; > > #CDATA > #if($skin) > $!data.setLayoutTemplate($!skin.getLayout()) > $!page.setCss($!skin.getCss()) > #end > #end > > so that the lines will be spat out as is onto the Torque/Texen output. I > also have some parts that require Texen to use the context, like; > > #foreach ($${colFKjn} in $all${colFKjn}s ) > > #end > > which, if ${colFKjn} is the State table, at the end of processing I would > want to come out something like; > > #foreach ($State in $allStates ) > > #end > > escaping off the first $ doesnt work, is there a way to do this currently? I > also tried setting; > > $dollar = "$" > > and putting it in as; > > \#foreach (${dollar}${colFKjn} in ${dollar}all${colFKjn}s ) >