On Wed, Dec 9, 2009 at 12:11 PM, Schneider Christian
<[email protected]> wrote:
> Hi all,
>
> we are using the file component to write xml data to a file. The xml data
> contains an element tradeId. The filename should be derived from the
> tradeId.
> Is this possible in the camel file component?
>
> I already found the fileName option and the file language. But did not
> understand how to access parts of the body from the expression.
>

You can just set the file name based on xpath and with some xpath
concat magic you can assemble it in one expression.
Otherwise then just use xpath to store it in a temp header

setHeader("foo").xpath("//tradeId/text()")

And then use ?fileName=coolfile-${header.foo}.xml


Or just use a bean
http://camel.apache.org/file-language.html

And use bean parameter binding to extract the xpath
http://camel.apache.org/parameter-binding-annotations.html




> Greetings
>
> Christian
>
>
>
> Christian Schneider
> Team Handel und Risikomanagement
> Informationsverarbeitung Business Solutions Trading
> EnBW Systeme Infrastruktur Support GmbH
>
> Informationsverarbeitung
> Business Solutions
> Handel und Dispatching
> Durlacher Allee 93
> 76131 Karlsruhe
>
> Tel : +49-(0)721-63-15482
> Mail: [email protected]
>
> Sitz der Gesellschaft: Karlsruhe
> Handelsregister: Amtsgericht Mannheim   HRB 108550
> Vorsitzender des Aufsichtsrats: Dr. Bernhard Beck
> Geschäftsführer: Jochen Adenau, Dr. Peter Krampf
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Reply via email to