Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C6415989E for ; Mon, 27 Feb 2012 01:44:53 +0000 (UTC) Received: (qmail 40671 invoked by uid 500); 27 Feb 2012 01:44:53 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 40635 invoked by uid 500); 27 Feb 2012 01:44:53 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 40626 invoked by uid 99); 27 Feb 2012 01:44:53 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Feb 2012 01:44:53 +0000 X-ASF-Spam-Status: No, hits=4.5 required=5.0 tests=HTML_MESSAGE,SPF_SOFTFAIL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: softfail (nike.apache.org: transitioning domain of ramesh.sridharan@ihg.com does not designate 216.139.236.26 as permitted sender) Received: from [216.139.236.26] (HELO sam.nabble.com) (216.139.236.26) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Feb 2012 01:44:46 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1S1pdZ-0006EM-Fo for users@camel.apache.org; Sun, 26 Feb 2012 17:44:25 -0800 Date: Sun, 26 Feb 2012 17:44:25 -0800 (PST) From: ramesri To: users@camel.apache.org Message-ID: In-Reply-To: References: <1329930388713-5505668.post@n5.nabble.com> <1330008573883-5508249.post@n5.nabble.com> Subject: Re: How to use escape tool ($esc.xml($somestrwithspclchars)) in camel velocity template MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_96969_25103219.1330307065484" X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_96969_25103219.1330307065484 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi Christian I get error when I try to set a ref as stated below. Because the doesnot allow as a valid content. Valid contents are only , , On Sat, Feb 25, 2012 at 8:32 AM, Christian Mueller [via Camel] < ml-node+s465427n5515124h70@n5.nabble.com> wrote: > As Claus suggested, use > > > > > > > > Best, > Christian > > On Fri, Feb 24, 2012 at 6:07 PM, ramesri <[hidden email]> > wrote: > > > Thank you all for the inputs. Its just that I am new to Camel and > having > > trouble to implement in Spring DSL what is suggested by Christian. Can > you > > pls show me how to do this in Spring DSL. Assuming that I define the > > EscapeTool as > class="org.apache.velocity.tools.generic.EscapeTool"/>, how do I > it > > in the ? > > > > Regards > > Ramesh > > > > On Fri, Feb 24, 2012 at 4:01 AM, Christian Mueller [via Camel] < > > [hidden email] > > wrote: > > > > > It's not only the velocity-tools provided classes what the user can > use > > > here. We have a custom class with some transformations (e.g. transform > > the > > > ISO two letter country code - e.g. "DE" - to the full name - e.g. > > > "Deutschland"). > > > May be adding some words how to use this functionality inside Camel on > > our > > > WIKI page is sufficient? I didn't like the idea to change the code > "only" > > > to autodetect the velocity-tools provided utillity classes - my 0,02 > $... > > > > > > Best, > > > Christian > > > > > > On Fri, Feb 24, 2012 at 8:44 AM, Claus Ibsen <[hidden email]< > > http://user/SendEmail.jtp?type=node&node=5512103&i=0>> > > > wrote: > > > > > > > On Thu, Feb 23, 2012 at 8:59 PM, Reuben Garrett <[hidden email]< > > http://user/SendEmail.jtp?type=node&node=5512103&i=1>> > > > > > > > wrote: > > > > > Ramesh, > > > > > > > > > > I'm not as knowledgeable as the committers, but it looks like > you're > > > > trying > > > > > to attach an instance of the EscapeTool class to a header in your > > > > Exchange > > > > > and then invoke it later on inside the Velocity template. But > when > > > you > > > > use > > > > > a expression in the Spring DSL, it just returns the > text > > > > within > > > > > the tags as a String. > > > > > > > > > > Christian's example in the Java DSL seems closer because it's > > actually > > > > > attaching a Class object (rather than the name of the class). > Maybe > > > if > > > > you > > > > > somehow instantiate an instance of EscapeTool and attach it to the > > > > > exchange, you'll then be able to invoke it. The Java DSL might > be > > > more > > > > > direct for this, but I'll bet there's an easy way to do it in the > > > Spring > > > > > DSL, too. > > > > > > > > > > That being said, I don't know much about Velocity. However the > > > > > > > > > expression doesn't seem to be what you want. > > > > > > > > > > > > > Yeah in XML DSLs you can use to refer to a bean to lookup and > > use. > > > > http://camel.apache.org/ref-language.html > > > > > > > > However maybe we can auto detect the velocity tools and provide it > out > > > > of the box? > > > > > > > > > > > > > Claus, Christian - am I on the right track? > > > > > > > > > > ~ RNPG > > > > > > > > > > On Thu, Feb 23, 2012 at 11:15, ramesri <[hidden email]< > > http://user/SendEmail.jtp?type=node&node=5512103&i=2>> > > > wrote: > > > > > > > > > >> Sorry, I set the header as and no luck. > > > > >> > > > > >> > > > > >> > > > > >> > > > > >> > > > > org.apache.velocity.tools.generic.EscapeTool.class > > > > >> > > > > >> > > > > >> > > > > >> > > > > >> Thanks > > > > >> Ramesh > > > > >> > > > > > > > > > > > > > > > > -- > > > > Claus Ibsen > > > > ----------------- > > > > FuseSource > > > > Email: [hidden email]< > > http://user/SendEmail.jtp?type=node&node=5512103&i=3> > > > > Web: http://fusesource.com > > > > Twitter: davsclaus, fusenews > > > > Blog: http://davsclaus.blogspot.com/ > > > > Author of Camel in Action: http://www.manning.com/ibsen/ > > > > > > > > > > > > > ------------------------------ > > > If you reply to this email, your message will be added to the > discussion > > > below: > > > > > > > > > http://camel.465427.n5.nabble.com/How-to-use-escape-tool-esc-xml-somestrwithspclchars-in-camel-velocity-template-tp5505668p5512103.html > > > To start a new topic under Camel - Users, email > > > [hidden email] > > > To unsubscribe from Camel - Users, click here< > > > > > > > . > > > NAML< > > > http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml > > > > > > > > > > > > > -- > > View this message in context: > > > http://camel.465427.n5.nabble.com/How-to-use-escape-tool-esc-xml-somestrwithspclchars-in-camel-velocity-template-tp5505668p5513385.html > > > Sent from the Camel - Users mailing list archive at Nabble.com. > > > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > > http://camel.465427.n5.nabble.com/How-to-use-escape-tool-esc-xml-somestrwithspclchars-in-camel-velocity-template-tp5505668p5515124.html > To start a new topic under Camel - Users, email > ml-node+s465427n465428h94@n5.nabble.com > To unsubscribe from Camel - Users, click here > . > NAML > -- View this message in context: http://camel.465427.n5.nabble.com/How-to-use-escape-tool-esc-xml-somestrwithspclchars-in-camel-velocity-template-tp5505668p5517811.html Sent from the Camel - Users mailing list archive at Nabble.com. ------=_Part_96969_25103219.1330307065484--