XFA Specification
Chapter 24, Picture Clause Specification
Complex Picture-Clause Expressions
908
Picture clause
'Balance on' date{MMM YY}: num{z,zz9.99}
Input value
Formatted result
1999-12 2157.50 "Balance on Dec 99: 2,157.50"
2003-12 50.60
"Balance on Dec 03: 50.60"
The first data item is a value representing the date Dec 1999, and the second data item is a numeric value.
The picture clause uses a bracketing syntax to partition the date picture sub-clause from the numeric
picture sub-clause. The left and right brace characters are reserved for this purpose, and therefore must
always be quoted within a picture clause to obtain a brace literal character.
The syntax for compound picture clauses is:
category-name{picture-symbols}
where category-name is one of the keywords
date
,
time
,
datetime
,
num
,
text
,
zero
, or
null
, and
picture-symbols corresponds to one or more picture symbols from a particular picture category. The
characters enclosed within the curly braces are interpreted as part of the picture clause.
Note that the quoted literals in the previous example could have appeared inside or outside of the braces
with equal results. Therefore the following compound picture clauses are all equivalent.
date{'Balance as of' MMM, YY}: num{z,zz9.99}
date{'Balance as of' MMM, YY: }num{z,zz9.99}
date{'Balance as of' MMM, YY}num{': 'z,zz9.99}
Explicitly stating the category-name is not required for picture clauses that contain picture symbols from
only one category; the processing application must attempt to infer the category based upon the symbols
found in the picture clause. If the symbols are ambiguous or too complex to automatically identify to a
category, then it is an error. Explicitly stating the category within the compound picture clause shall always
take precedence over any other interpretation of the picture clause by the processing application.
Locale-Specific Picture Clauses
Picture clauses can specify the prevailing locale to use for picture processing. This ability is useful when
formatting or parsing locale-specific data (such as dates, times or currencies) for a locale that differs from
any template-declared locales or from the ambient locale. (See also
“Determining the Prevailing Locale”
on page 904)
Note:
Starting with XFA 2.4 this standard fully supports locales where the ordinary flow of text is right to
left, as well as the left to right locales previously supported. However, regardless of the locale,
picture clauses are always processed from left to right (i.e. document order). In circumstances where
the flow of text is also left to right this means the picture clause more or less resembles the data to
be put out or taken in. However when the flow of text is right to left the picture clause resembles a
mirror image of the data. This is not an error. The picture clause itself
must
be parsed in a
locale-independent way.
The syntax for specifying a locale-specific picture clause is:
category-name(locale-name){picture-symbols}
or
category-name.subcategory-name(locale-name){}
Home Index Bookmark Pages
Pages: Home Index All Pages