Generating Functionality Equivalent to an Array of an Empty Element
The genEmptyElem function generates functionality equivalent to an array of an empty element to an XML structure. This function takes the following arguments:
genEmptyElem('ElemQName',int?, 'TypeQName'?, boolean?)
Note the following issues:
-
The first argument specifies the
QNameof the empty elements. -
The optional second integer argument specifies the number of empty elements. If missing, the default size is
1. -
The third optional argument specifies the
QName, which is thexsi:typeof the generated empty name. Thisxsi:typepattern matches theSOAPENC:Array. If it is missing or is an empty string, thexsi:typeattribute is not generated. -
The fourth optional boolean argument specifies whether the generated empty elements are
XSI - nil, provided the element is XSD-nillable. The default value isfalse. If missing orfalse,xsi:nilis not generated.
The following example shows an append statement initializing a purchase order (PO) document with 10 empty <lineItem> elements under po:
<bpelx:assign>
<bpelx:append>
<bpelx:from expression="ora:genEmptyElem('p:lineItem',10)" />
<bpelx:to variable="poVar" query="/p:po" />
</bpelx:append>
</bpelx:assign>
The genEmptyElem function in the previous example can be replaced with an embedded XQuery expression, as shown in the following example:
ora:genEmptyElem('p:lineItem',10)
== for $i in (1 to 10) return <p:lineItem />
The empty elements generated by this function are typically invalid XML data. You perform further data initialization after the empty elements are created. Using the same example above, you can perform the following:
-
Add attribute and child elements to those empty
lineItemelements. -
Perform
copyoperations to replace the empty elements. For example, copy from a web service result to an individual entry in this equivalent array under a flowN activity.