On 02/08/06, amelaao <[EMAIL PROTECTED]> wrote:
 I think my problem comes from the way I'm referencing this variable created
by RegEx from BeanShell.

Yes, see below.

My RegEx look like:

ReferenceName:       Attributes
Regular Expression: <ProductAttributes>(.+?)</ProductAttributes>
Template:                $1$
Match No:               1

and the BeanShell function string:

${__BeanShell(String str=vars.get("${Attributes}"); String newstr =
str.replace("<"\,"<p:"); return newstr;, )} .


${Attributes} will be replaced by the contents of the variable; you
are then looking this up as a variable, which won't exist.

Try

${__BeanShell(${Attributes}.replace("<"\,"<p:"))}

So long as Attributes does not contain any commas, it should work.

If it does contain a comma, try:

${__BeanShell(vars.get("Attributes").replace("<"\,"<p:"))}


 I tried many combinations of
                 vars.get("${Attributes}");
                vars.get("${Attributes_g1}");
                 vars.get("Attributes"); inside this BeanShell but each
returns null, although the RegExpression variable Attributes displayed
through a separate JavaRequest Sampler is perfectly valid, not null,
XML string.

That is because you are de-referencing the variable twice...

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to