camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: How to indent output of an qxuery transformation
Date Sun, 30 Sep 2012 09:45:55 GMT
On Sat, Sep 29, 2012 at 9:54 PM, Babak Vahdat
<babak.vahdat@swissonline.ch> wrote:
> Hi
>
> Welcome to the Camel community!
>
> The solution to your problem (as Claus has already mentioned it) is to add a
> property, that's:
>
>
> myCamelContext.getProperties().put("org.apache.camel.xmlconverter.output.indent",
> "yes");
>

Maybe we should consider this by default? Most people want the XML to
be nicely outputted.


> At very beginning *before* you start routing (believe me as I've already
> tested it :-)).
>
> The "point" is that the default properties the Camel's own XmlConverter uses
> (that's org.apache.camel.converter.jaxp.XmlConverter) does not add the
> following property:
>
>    properties.put(OutputKeys.INDENT, "yes");
>
> To the defaults (see the method defaultOutputProperties() of it).
>
> So that we do this by ourselves as the value of the constant
> "javax.xml.transform.OutputKeys.INDENT" is equal "indent".
>
> More elegantly you could also make use of Camel's Property component to set
> this property (instead of the one liner above):
> http://camel.apache.org/properties.html
>
> Babak
> PS: The underlying XQuery engine of Camel is Saxon which uses three spaces
> for indention *if* you ask it to do so.
>
>
> rhuiser wrote
>> Greetings all,
>>
>> I would like the output of my xquery transformation to be indented (it is
>> now a single line which is hard to read by humans).
>>
>> I am using:
>> <to uri="xquery:openTermDepositRequest.xquery"/>
>> ..are there parameters/options I can add?
>>
>> Thanks in advance,
>> Robin Huiser
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/How-to-indent-output-of-an-qxuery-transformation-tp5720230p5720245.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Mime
View raw message