What expression or query will yield a variable reference?
In the specification, section 8.2.1 "Enclosing Elements", it says:
Evaluation of a WS-BPEL expression or query will yield one of the
following ...:
- a single XML infoset item ...
- a collection of XML infoset items ...
- a sequence of CIIs for simple type data ...
- a variable reference: e.g. <from>$myFooVar</from>
English is not my mother tongue, but here I read "yied" as "evaluate to". In this understanding, I do not understand the variable reference: Why would the expression
"$myFooVar" not result in either single XML infoset item or sequence of
CIIs?
What exactly is meant by "variable reference"? I tried to categorize the
types of queries and expressions, but I cannot see which kind of
expressions that should yield a variable reference.
The example <from>$myFooVar</from> must be a General Expression as
listed in section 8.3 "Expressions", because of the from-tags.
In section 8.3.5 "General Expressions", is says that general expressions
"results in any XPath value type (string, number, or Boolean)." (I guess node-set should be listed here too, but that is another issue)
However, in section 8.4 "Assignment" under "Expression variant" is says:
This computed value of the expression MUST be one of the followings:
- a single XML information item other than a CII ...
- a sequence of zero or more CIIs ...
So I cannot figure out how the general expression "<from>$myFooVar</from>" should evaluate to a variable reference or what a "variable reference" in this context is defined as.
I am looking forward to hearing your opinion. Thanks.
Expressions will not yield a
Is the meaning of "variable reference" equivalent to lvalue?
I am sorry, I have not studied the assignment section in details yet. Is the meaning of "variable reference" equivalent to lvalue, as used later in the specification?
Your answer confuses me about how the specification distinguish between queries and expressions. As I understand the specification, the main difference is, that a query is evaluated against a context node, while expressions are self-contained. Also, queries are wrapped in <query> tags, thus <to>$myFooVar</to> is an expression, even though it produces an lvalue.
This may be an irrelevant observation, but I just want to make sure, that I am not missing something important here.
Thanks.
Sorry for the confusion
I should have mentioned "lvalue". You are also correct about the variant expression form of the to-spec.