camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: [DISCUSS] - XML DSL and trimming value
Date Sun, 20 May 2012 14:27:37 GMT
Hi

Just a heads up you can now easier add new lines in XML DSLs as I
added support for using escaped values in the XML DSLs.
https://issues.apache.org/jira/browse/CAMEL-5295

eg from an unit test in XML DSL you can do, notice the \n to indicate new line.

        <transform>
          <simple>
            Body is\non new line ${body}\n
          </simple>
        </transform>




On Sun, May 20, 2012 at 12:33 PM, Claus Ibsen <claus.ibsen@gmail.com> 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
>
> <transform>
>  <simple>
>    data=${body}
>  </simple>
> </transform>
>
> Notice how we have new lines in the <simple> text.
> Below shows what the intent is without newlines:
>
> <transform>
>  <simple>data=${body}</simple>
> </transform>
>
> 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
> <transform>
>  <simple>data=${body}\n</simple>
> </transform>
>
> I think we should go for a
> - auto trim all expressions
> - end users can use \n to force new lines
>
> Any thoughts?
>
>
>
>
> --
> Claus Ibsen
> -----------------
> CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
> FuseSource
> Email: cibsen@fusesource.com
> Web: http://fusesource.com
> Twitter: davsclaus, fusenews
> Blog: http://davsclaus.blogspot.com/
> Author of Camel in Action: http://www.manning.com/ibsen/



-- 
Claus Ibsen
-----------------
CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Mime
View raw message