XFA Specification
Chapter 24, Picture Clause Specification
Complex Picture-Clause Expressions
909
where category-name and picture-symbols are as before, and locale-name is the name of a locale
conformant to the locale naming standards defined above.
Picture clause
date(fr){DD MMMM, YYYY}
Input value
2002-10-25
Formatted result
25 octobre, 2002
viernes, 25 de octubre de 2002
25 octobre, 2002
date(es){EEEE, D 'de' MMMM 'de' YYYY} 2002-10-25
date.long(fr)()
2002-20-25
Locale-Specific, Compound Picture Clauses
Picture clauses may be assembled into a series of locale-specific picture clauses, using the following
syntax:
category(locale){picture-clause} category(locale){picture-clause}
Locale-specific compound picture clauses are supported; however, their usefulness is limited since most
individual data items pertain to a single locale.
Alternate Picture Clauses
There are circumstances when raw data may be in one of many formats, yet the formatting capabilities of
picture clauses are still desired. For example, if inputting phone numbers, the user might prefer omitting
the area code of local numbers, so the processing application might be required to parse ten digit
numbers and seven digit numbers, both being equally valid. To that end, we provide alternative picture
clauses. These are simply a series of picture clauses separated by a vertical bar (
|
) character. Everything to
the right of the vertical bar character up to another vertical bar or the end of the picture clause is one
picture clause alternative.
The syntax for alternate picture clauses is:
picture-clause|picture-clause[|picture-clause...]
where picture-clause is as defined above, and the square brackets and ellipses denote optional, repeated,
alternate picture clauses. Thus, the vertical bar character is reserved for delimiting alternate picture
clauses, and therefore, must always be quoted within a picture clause to obtain the vertical bar literal
character.
During input parsing and output formatting against a set of alternate picture clauses, the XFA processing
application chooses the picture clause to use, by sequentially matching the data against each picture
clause in the expression, stopping when a match is found. The picture clauses are examined in order from
left to right.
The following table presents examples of input parsing with alternate picture clauses. The parsed result is
the canonical format of the data. Picture clauses used for input parsing are relevant only when the picture
clause appears in a
ui
,
bind
, or
connect
element.