Or, to be more like you wrote:
from("file:input")
.setHeader("MyIdVar", xpath("/order/id"))
.to("file:output?fileName=${in.header.MyIdVar}");
On Wed, May 16, 2012 at 2:06 PM, Björn Bength <[email protected]> wrote:
> something like should work:
>
> from("file:input")
> .setHeader("CamelFileName", xpath("/order/id"))
> .to("file:output");
>
> Regards
> B
>
>
> On Tue, May 15, 2012 at 5:24 PM, Charpente <[email protected]> wrote:
>> Hi,
>>
>> I would like to know if it's possible to integrate a variable, like a
>> String, in a route.
>>
>> For example:
>>
>> ParserXml parser = new ParserXml();
>> String idValue = parser.getIdValue();
>>
>> from("file:input").to("file:output$fileName=idValue.xml");
>>
>> I know that in this example the filename will be idValue.xml, but I would
>> like to have the contents of this variable as filename
>>
>> Is it possible?
>>
>> Thanks
>>
>> --
>> View this message in context:
>> http://camel.465427.n5.nabble.com/How-to-use-variable-in-an-endpoint-tp5710143.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.