title: With camel, how do I use the value of a header to define an XPath expression?
body: <p>I have a header which has an XPath definition in it:</p>
  
  <pre><code>myXPath = "/bookshop/author/books/1|/bookshop/author/books/2"
  </code></pre>
  
  <p>and I'd then like to use this in an Xpath expression to set another header something like this:</p>
  
  <pre><code>&lt;setHeader headerName="authorBooks"&gt;
      &lt;xpath resultType="org.w3c.dom.NodeList"&gt;${in.header.myXPath}&lt;/xpath&gt;
  &lt;/setHeader&gt;
  </code></pre>
  
  <p>Reading the <a href="https://camel.apache.org/xpath.html" rel="nofollow noreferrer">docs</a> it seems you can use header values as part of your expression, but not to define the whole thing? I tried this and it didn't work:</p>
  
  <pre><code>&lt;xpath resultType="org.w3c.dom.NodeList"&gt;in:header('myXPath')&lt;/xpath&gt;
  </code></pre>
  
  <p>Anyone know of a way of doing this? I found this bug which seems to do what I want, but it's not slated to get fixed until 3.0:
  <a href="https://issues.apache.org/jira/browse/CAMEL-3697" rel="nofollow noreferrer">https://issues.apache.org/jira/browse/CAMEL-3697</a></p>