The way this is used is to enable you to get a variable re-evaluated when the
xpath specified in a local parameter is relative. You simply use the
evaluateVariable($variableName) If this fails try without the $.
The idea is for when you have repeating patterns such as orderlines and you
want a variable to be set that say should contain the orderLineID. So when you
come to the orderline you assocciate a rule with the OrderLine element and get
the value of the variable reset for this new Orderline.
I hope this helps.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It returns an error "Variable has not been declared." The variable keeps the
first evaluated xpath expression value. Has it worked for you? Perhaps it is a
bug.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You declare the variable in the header. Use the Parameters tab at the bottom
of the screen to declare the variable you are referencing. Here's an example
of what gets added to header.
If you were already doing this - and still getting error - please could you
post simple example template and XML so we can debug?
Thanks for the example - seems like there's three things happening at once
here. We'll break this down and make some examples illustrating each part. The
setValue should be conditional I believe - based on no value existing in
node2. Also XPath expressions does allow direct equals comparison. Will post
something back shortly...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
As a foot note to this - the evaluateVariable and Parameter declarations are
really for use as a shorthand for something globally referenced in a
conditional expression. So say I need to check that one group of partners
messages - contain a specific code value. The partners all have ID numbers
beginning with BANK say - so I could setup a parameter that checks begins-
with(ID,'BANK') - and then whenever I need to check that I can use the
shorthand parameter name.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
How do you use the evaluateVariable function? Can anyone provide a sample on
how a local/global parameter is used?
The way this is used is to enable you to get a variable re-evaluated when the
xpath specified in a local parameter is relative. You simply use the
evaluateVariable($variableName) If this fails try without the $.
The idea is for when you have repeating patterns such as orderlines and you
want a variable to be set that say should contain the orderLineID. So when you
come to the orderline you assocciate a rule with the OrderLine element and get
the value of the variable reset for this new Orderline.
I hope this helps.
It returns an error "Variable has not been declared." The variable keeps the
first evaluated xpath expression value. Has it worked for you? Perhaps it is a
bug.
You declare the variable in the header. Use the Parameters tab at the bottom
of the screen to declare the variable you are referencing. Here's an example
of what gets added to header.
If you were already doing this - and still getting error - please could you
post simple example template and XML so we can debug?
<as:Header> <as:Description>Example template header</as:Description>
<as:Owner>To be Completed</as:Owner> <as:Version>0.1</as:Version>
<as:DateTime>2011-01-12T15:42:32</as:DateTime> <as:Parameters> <as:Parameter name="CheckThis" values="'1'|'2'|'3'" xpath="\\Organization\\@Usage" use="local"/> </as:Parameters> </as:Header>
The goal is to check Value1 == Value2 in each Node.
Thanks for the example - seems like there's three things happening at once
here. We'll break this down and make some examples illustrating each part. The
setValue should be conditional I believe - based on no value existing in
node2. Also XPath expressions does allow direct equals comparison. Will post
something back shortly...
I believe this does what you were trying to do above.
As a foot note to this - the evaluateVariable and Parameter declarations are
really for use as a shorthand for something globally referenced in a
conditional expression. So say I need to check that one group of partners
messages - contain a specific code value. The partners all have ID numbers
beginning with BANK say - so I could setup a parameter that checks begins-
with(ID,'BANK') - and then whenever I need to check that I can use the
shorthand parameter name.