camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Babak Vahdat <babak.vah...@swissonline.ch>
Subject Re: How to indent output of an qxuery transformation
Date Sat, 29 Sep 2012 19:54:43 GMT
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");

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.

Mime
View raw message