XFA Specification
Chapter 15, Template Specification
Guide to the Template Specification
421
the enclosing element. Observe the following example of a filled white rectangle, with rounded corners
and alternating solid and dashed edges:
<Draw>
<Fill>
<Color Value="255,255,255">
<Solid/>
</Fill>
<Value>
<Rectangle>
<Corner Join="Round"/>
<Edge Stroke="Solid"/>
<Edge Stroke="Dashed"/>
</Rectangle>
</Value>
</Draw>
In the example above, we see that the
Edge
element has been multiply specified in the rectangle; the
Edge
and
Corner
elements are both specified as multiple occurrence XFA element types, and so each
element contributes to the definition of some part of the rectangle. The
Fill
element is specified as a
single occurrence XFA element type, and therefore only one of the occurrences of the element will
contribute to the definition of the object.
Observe the following adaptation of the previous example of a white rectangle:
<Draw>
<Fill>
<!-- A white color fill -->
<Color Value="255,255,255">
<Solid/>
</Fill>
<Value>
<Rectangle>
<Corner Join="Round"/>
<Edge Stroke="Solid"/>
<Edge Stroke="Dashed"/>
</Rectangle>
</Value>
<Fill>
<!-- A black color fill -->
<Color Value="0,0,0">
<Solid/>
</Fill>
</Draw>
In the example above, the draw element incorrectly contains two
Fill
elements. If the processing
application encounters such an XFA Template that expresses an excessive number of a given element, the
processing application may consider this an error or continue processing. If the application chooses to
continue processing, it must accept only the first occurrence of the given element. Therefore, in the
previous example the rectangle would have a fill of white (color value of 255,255,255).
Multiply Occurring Elements
Elements that are defined as multiply occurring are permitted to be defined more than once within the
scope of the enclosing element. Multiply occurring elements are used to represent array-type properties
or sub-objects aggregated by the enclosing element.