On Wed, Apr 26, 2017 at 11:26 PM, jan.schjoenning <jan.schjoenn...@gmail.com
> wrote:

> Given following route :
>
>                 from("direct:TranslateEpgData")
>                 .routeId("TranslateEpgData")
>                 .setHeader("xxx", constant("xxx"))
>                    .to("log:?showAll=true&multiline=true")
>                    .log("serviceId = ${header.serviceId}, scheduleStart =
> ${header.scheduleStart}, scheduleEnd = ${header.scheduleEnd}, originId =
> ${header.originId}")
>                    .to("log:?showAll=true&multiline=true")
>                    .to("xslt:whatson_to_tvanytime.xsl")
>                    .log("${body}");
>
> 1. log of ${header.serviceId} =
> serviceId=com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList@7e5afaa6
>
> 2. log of ${header.serviceId} = TV2ZULU
>
> 3. log of ${header.serviceId} =
> serviceId=com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList@7e5afaa6
>
> As flow states no changes between , why do i have this difference ?
>
>
Because .to("log:...") uses the Log Component[1] while .log("...") uses the
Log EIP[2], which uses the Simple language[3].

If you want .to("log:?showAll=true&multiline=true") to show the content of
the XML nodelist as .log("serviceId = ${header.serviceId}...") does, then
you should specify the result type when setting the header[4].

I've been caught by this before and have learned to always provide a result
type when using xpath expressions.

Hope that helps,
Doug

[1] http://camel.apache.org/log.html
[2] http://camel.apache.org/logeip.html
[3] http://camel.apache.org/simple.html
[4] http://camel.apache.org/simple.html#Simple-SettingtheResultType

Reply via email to