XFA Specification
Chapter 3, Object Models in XFA
Scripting Object Model
95
by default yields four nodes corresponding the elements enclosed within the first
Detail
element. The
default behavior is that attributes are not loaded into the Data DOM. However if attributes had been
loaded there would have been an additional node, representing the
PartNo
attributes on the
Detail
element, included in the set. See
“Basic Data Binding to Produce the XFA Form DOM” on page 154
for
more information about loading of attributes into the Data DOM.
Selecting All Sibling Nodes
The syntax
"[*]"
can be used to select all sibling nodes that share a name. For example, given the same
data from
Example 3.2,
the expression
$data.Receipt.Detail[*]
yields the two
Detail
nodes which are children of the
Receipt
node. The set does not include their
sibling
Page
,
Sub_Total
,
Tax
, and
Total_Price
nodes.
Selecting a Subset of Sibling Nodes
The syntax
" .[formcalc_expression] "
can be used to select all sibling nodes that match the given
expression. The contained expression must yield a Boolean value.
The same set selection can be expressed using the form
" .(ecmascript_expression)"
. This format
is compliant with section 11.2.4 of the ECMAScript-357 standard
[ECMAScript357].
Again the contained
expression must yield a Boolean value.
For example, given the same data from
Example 3.2,
the SOM expression
$data.Receipt.Detail.(Total_Price.value < 300)
yields the the single
Detail
node which its the
Total_Price
property set to
250.00
. An exactly
equivalent SOM expression can be written using FormCalc syntax:
$data.Receipt.Detail.[Total_Price < 300]
By contrast either
$data.Receipt.Detail.(Total_Price.value >= 300)
or
$data.Receipt.Detail.[Total_Price >= 300]
yields the single
Detail
node which has its
Total_Price
property set to
334.80
.
Finally, either
$data.Receipt.Detail.(Total_Price.value < 1000)
or
$data.Receipt.Detail.[Total_Price < 1000]
yields both
Detail
nodes.
If an error is encountered while evaluating the expression the error condition is processed immediately
without evaluating the expression against any more siblings.
Home Index Bookmark Pages
Pages: Home Index All Pages