JMeter (Beanshell sampler) Token Parsing Error: Lexical error at line 2, column 15. Encountered: "?"
<p>I'm passing XML from a variable into a string:</p>

<pre><code>def request = '${variable}'
</code></pre>

<p>When I run my beanshell script, the response shows the following (note; line 1 is a comment):</p>

<pre><code>Token Parsing Error: Lexical error at line 2, column 15.  Encountered: "?"
</code></pre>

<p>I believe it could be resolved by escaping the question mark (so "\\?" in stead of "?"), but I don't know how to do this in this specific example. Does anyone have an idea about this?</p>