On Sun, Sep 30, 2012 at 12:06 PM, Raul Kripalani <[email protected]> wrote:
> Hi Claus,
>
> I would say no. Automatic pretty print interferes with log files, forcing
> log statements to become multiline.
>

If you enable CXF logging then its SOAP content is multiline.
And IMHO its not good practice to log message content in production
logs (sensitive information being open to dev-ops).


> And it also interferes with systems that parse XML via plaintext string
> functions.
>

Parsing XML you would need to take account for whitespace noise. There
is no validation that would forbid whitespace in an XML document. So
anyone parsing XML would need to take that into account.

> Instead, I propose that we document this feature better in a FAQ and link
> to it from the XML-related doc pages.
>

Yes docs for current behavior and how to fix this is a good idea.

> As a side note, in XSLT pretty print is enabled via the 'indent' attribute
> of the xsl:output instruction. In practice, you also need to set
> xsl:strip-space to star (*).
>

Yeah but a lot of people are not XSLT ninjas. They are looking for an
easy to use option on the Camel component: prettyPrint=true|false. Or
whatever name the option is.

And with an option on the Camel components, people can control this
more fine grained, instead of some JVM level system property (that is
hard to adjust on a production server), or a context level property on
CamelContext that affects the entire Camel context.


> Regards,
> Raúl.
>
> Sent from a mobile device
> On Sep 30, 2012 10:46 AM, "Claus Ibsen" <[email protected]> wrote:
>
>> On Sat, Sep 29, 2012 at 9:54 PM, Babak Vahdat
>> <[email protected]> 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: [email protected]
>> Web: http://fusesource.com
>> Twitter: davsclaus
>> Blog: http://davsclaus.com
>> Author of Camel in Action: http://www.manning.com/ibsen
>>



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

Reply via email to