Hi, After dug the code of XQuery, and wrote a simple test, I found you can get the header value like this. I suppose you have set the in message header "foo" with the value of "bar" You need to define the variable in your template file just like this, then you can use this variable as your want.
declare variable $foo as xs:string external; <transformed subject="{mail/subject}" sender="{$foo}"> {.} </transformed> I'm also filled a JIRA[1] with better name of in message header, so you can reference the headers value with variable name like this $in.headers.foo. [1] https://issues.apache.org/activemq/browse/CAMEL-1559 Willem Claus Ibsen wrote: > Hi Roger > > Any news on this? > I am super busy at the moment so I havent had the time to help out. > > > > On Mon, Apr 20, 2009 at 7:47 PM, rogster <eric.d.eb...@lmco.com> wrote: >> I need to access camel context header variables in my XQuery endpoint. >> >> So in my context file i do something to this effect: >> <from ........ >> <setHeader headerName="foo"> >> <constant>bar</constant> >> </setHeader> >> <to uri="xquery:getHeaders.xquery"/> >> >> where my xquery does something very simple like this: >> >> <headerValue> >> { $in.headers.foo } >> </headerValue> >> >> // I also tried just $foo etc... Always with an error message that the >> variable wasn't defined. >> >> I've looked at the Jira https://issues.apache.org/activemq/browse/CAMEL-918 >> https://issues.apache.org/activemq/browse/CAMEL-918 and at some of the >> related Jiras about updating documentation of this sort of thing but have >> come up empty. >> >> Any help available? >> >> Thanks >> Rog >> -- >> View this message in context: >> http://www.nabble.com/Accessing-header-variables-in-XQuery-endpoints-tp23141569p23141569.html >> Sent from the Camel - Users (activemq) mailing list archive at Nabble.com. >> >> > > >