Return-Path: X-Original-To: apmail-camel-dev-archive@www.apache.org Delivered-To: apmail-camel-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7D42E9F96 for ; Mon, 21 May 2012 14:31:19 +0000 (UTC) Received: (qmail 2846 invoked by uid 500); 21 May 2012 14:31:19 -0000 Delivered-To: apmail-camel-dev-archive@camel.apache.org Received: (qmail 2818 invoked by uid 500); 21 May 2012 14:31:19 -0000 Mailing-List: contact dev-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list dev@camel.apache.org Received: (qmail 2807 invoked by uid 99); 21 May 2012 14:31:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 May 2012 14:31:19 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of hzbarcea@gmail.com designates 209.85.161.173 as permitted sender) Received: from [209.85.161.173] (HELO mail-gg0-f173.google.com) (209.85.161.173) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 May 2012 14:31:11 +0000 Received: by ggnp1 with SMTP id p1so5323432ggn.32 for ; Mon, 21 May 2012 07:30:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=b7U3wekdS1qVVNSpZAEO+vBdUyR5MckcCaHFvc69lAc=; b=HO6EowEhB3GPN2GGFh2gDLk1GAJcnwKHwCeguZ/67Zgx6OJT7xRFlS3A2CxVy16l2J NKQKR/5GgpRN/ePLtY2ia9ZyRBSTayFBwyFNVeWnUAEiQ74nzj8SOgk0/V0hlwJ/yxnm 2rZR9V9n0UZifjLicM1MSk+FxodQny/hq9BtHN+gprHR2fsbzDRajd1r8ayDb9Qkw9+P 1CNaK/GKf3kLvitIjY7gB9+UGdo0Pl4kI1me/T6/cW7WPKVEjoXDvbdBRPsG68AuFuwH IrXUh4UCAfGp3MTYsyhsrI6deCnKch+aiqMdeThn7uPvBm9NMJirPlbeiCXO5QehnlJJ wxHg== Received: by 10.236.182.7 with SMTP id n7mr23190925yhm.61.1337610650756; Mon, 21 May 2012 07:30:50 -0700 (PDT) Received: from [10.40.58.211] (cpe-065-190-020-023.nc.res.rr.com. [65.190.20.23]) by mx.google.com with ESMTPS id j39sm33546988ani.3.2012.05.21.07.30.49 (version=SSLv3 cipher=OTHER); Mon, 21 May 2012 07:30:49 -0700 (PDT) Message-ID: <4FBA5198.3030907@gmail.com> Date: Mon, 21 May 2012 10:30:48 -0400 From: Hadrian Zbarcea User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 MIME-Version: 1.0 To: dev@camel.apache.org Subject: Re: [DISCUSS] - XML DSL and trimming value References: <4FB9155B.9050004@gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org IMO, that's something easily and better solved by properly documenting the functionality and expectations. A simple note in the wiki would achieve the same goal. I doubt there'll be a significant number of developers complaining that the expression must follow immediately after the tag and they don't have the flexibility to add spaces/tabs/crlf if they wanted to. To me this is a non issue (and yes I am fully aware that we're talking about the xml dsl as the subject says). The only thing we'd do is add unnecessary complexity. On top of that it's a part of camel that is not even used at runtime, it's just the route creation. I think we already went too far down the path of accommodating dubious scenarios and to me, this is one of them. What problem exactly are we trying to solve? A user being unwilling to put the expression after the tag? A tool that generates xml and has the limitation that the text node will be on a separate line? I don't quite get it. Hadrian On 05/20/2012 03:28 PM, Claus Ibsen wrote: > On Sun, May 20, 2012 at 6:01 PM, Hadrian Zbarcea wrote: >> My vote would be for *no* auto trim. Makes things predictable and easy to >> understand. >> >> Hadrian >> > > Well yeah we should improve on this. > > What I am talking about is the XML DSLs. This is the ones where people > is struggling when you can have "spaces" around your expressions due > coding style and whatnot. > > You dont have this problem for other expressions such as xpath. This > is what you can do today > > > > > > > /person[@name='James'] > > > > > > > Which would be the same as > > > > > > /person[@name='James'] > > > > > > People is most likely accustomed to the "free form" in XML, where the > "whitespace noise" is trimmed by default. > > > > > What we could do, and should do IMHO, is to add an attribute to the > expressions in Camel XML DSLs so you can turn trimming on|off. > > > I want no trim please > And I can do as I want > > > And by having trim default to true, we can have the Camel expressions > in the XML DSL behave consistent, and not include the "whitespace > noise" by default. > > > >> >> On 05/20/2012 06:33 AM, Claus Ibsen wrote: >>> >>> Hi >>> >>> We have a number of JIRA tickets which is related >>> https://issues.apache.org/jira/browse/CAMEL-5294 >>> https://issues.apache.org/jira/browse/CAMEL-5285 >>> https://issues.apache.org/jira/browse/CAMEL-4990 >>> >>> When you use the XML DSLs you may have a coding style where you have >>> newlines, and spaces etc. in the text of the XML tags, eg >>> >>> >>> >>> data=${body} >>> >>> >>> >>> Notice how we have new lines in the text. >>> Below shows what the intent is without newlines: >>> >>> >>> data=${body} >>> >>> >>> Today we will auto trim Simple expressions (but not the others). IMHO >>> I think this is wrong and we should make this consistent, to either >>> - no auto trim >>> - auto trim all expressions >>> >>> If we auto trim, and you want an explicit newline, then the end user >>> can use a \n to indicate newline, eg >>> >>> data=${body}\n >>> >>> >>> I think we should go for a >>> - auto trim all expressions >>> - end users can use \n to force new lines >>> >>> Any thoughts? >>> >>> >>> >>> >> > > >