XFA Specification
Chapter 11, Forms That Initiate Interactions with Servers
Using Web Services
338
...
</subform>
...
</subform>
In this example, the input subform has a ref property asserting a fully-qualified SOM expression
“
!connectionData.TickerPriceWS.Body
”. Because this is fully-qualified it does not matter what
value of “$”, if any, it inherits from its parent. The expression resolves to
xfa.datasets.connectionData.TickerPriceWS.Body
. Its child subform
TradePriceRequest
inherits the node
xfa.datasets.connectionData.TickerPriceWS.Body
as its base location. The
TradePriceRequest
subform in turn has a
connect.ref
asserting a relative SOM expression,
“
TradePriceRequest
”. This combines with the inherited base, resolving to
xfa.datasets.connectionData.TickerPriceWS.Body.TradePriceRequest
. This resolved
node in turn becomes the base location inherited by the field
stockTickerSymbol
, which is the child of
input. The field has a
connect.ref
asserting the relative SOM expression “
tickerSymbol
”. This
combines with the inherited base to resolve into
xfa.datasets.connectionData.TickerPriceWS.Body.TradePriceRequest.tickerSymbol
. Hence,
the effect is the same as the earlier syntax.
The inheritance mechanism has an important advantage when dealing with arrays of data (sets of sibling
data nodes sharing the same name). The rules for resolving SOM expressions allow the expression to leave
out some subscripts. When the subscript is omitted from an unqualified reference, the XFA processor uses
the subscript of the container in the Form DOM that is asserting the SOM expression. (Or it may use the
subscript of an ancestor.
See “Inferred Index for Ancestors of the Container” on page 108.
possible to use dynamic subforms. Such a subform is declared just once in the template but allowed to
instantiate multiple times in the Form DOM. Using an unqualified SOM expression, each of its
instantiations correctly references the data, even though each instantiation uses the same SOM
expression. Index inferral does not apply to fully-qualified SOM expressions. The inheritance mechanism
makes it possible to use unqualified SOM expressions and thus to take advantage of index inferral.
Data Conditionally Copied Between the Data DOM and the Connection Data DOM
The usage attribute controls whether data is copied from the Data DOM to the Connection Data DOM
(
exportOnly
), from the Connection Data DOM to the Data DOM (
importOnly
), or both ways
(
exportImport
). The effect of copying data both ways with
exportImport
is to update the data. This is
not required for the example application. Hence, in the example fragments, the field associated with the
input message has a
connect.usage
of
exportOnly
.
After the message is marshalled in the Connection Data DOM, but before it is sent, the
preExecute
event
triggers. A script activated by
preExecute
can modify the input message before it is sent. It is also
acceptable for a
preExecute
script to programmatically copy data out of the Connection Data DOM. For
example, the following fragment shows some debug code in a test template:
<field name="PREEXECUTE" ...> ... </field>
<event activity="preExecute"
ref="$connectionSet.TickerPriceWS">
<script>
PREEXECUTE =
$xfa.datasets.connectionData.TickerPriceWS.saveXML();
</script>
</event>
In the example, when the
preExecute
script is invoked, the Connection Data DOM contains:
[dataGroup (soap:Body)