Chapter 4, Exchanging Data Between an External Application
and a Basic XFA Form
XFA Specification
Localization and Canonicalization
142
1. Explicit declaration in the picture clause, for example
date(fr){DD MMMM, YYYY}
.
2. Template field or subform declarations, using the
locale
property.
3. Ambient locale.
Ambient locale
is the system locale declared by the application or in effect at the time
the XFA processing application is started. In the event the application is operating on a system or
within an environment where a locale is not present, the ambient locale defaults to English United
States (
en_US
).
Canonicalization of dates, all of which parse to 20041030
Input data (in locale-format)
"30. Oktober 2004"
"30 octobre 2004"
"30 October 2004"
Field
name
FieldA
FieldA
FieldB
Picture Clause
D. MMMM YYYY
D MMMM YYYY
MMMM D, YYYY
Locale
de_CH
fr_CA
en_CA
About the Canonical Format Used in the Data and Form DOMs
Inside the Data and Form DOMs, data is always stored in a
canonical format,
in which date, time, date-time,
and numbers are represented in a standard (canonical) format (“Canonical
Format Reference” on
page 797).
For example, the canonical format for dates are as follows:
YYYY[MM[DD]]
YYYY[-MM[-DD]]
In the above examples, letters represent the numeric values described below, square brackets delineate
optional parts, and dashes (-) represent literals.
Symbol
YYYY
MM
DD
Meaning
Zero-padded 4-digit year.
Zero-padded 2 digit (01-12) month of the year.
Zero-padded 2 digit (01-31) day of the month.
About Picture Clauses
A picture clause is a sequence of symbols (characters) that specify the rules for formatting and parsing
textual data, such as dates, times, currency, and numbers. Each
symbol
is a place-holder that typically
represents one or more characters that occur in the data. Some picture clause symbols are locale-sensitive
and some are not. Hence, by specifying the appropriate operators the form creator fully controls
localization on a field-by-field, and even character-by-character, basis.
When canonicalizing input data, a particular picture is used only if it matches the pattern of the input data.
When the picture clause contains multiple alternate picture clauses, the data is compared to each pattern
in sequence, until one is found that matches. If none of them match, the data is treated as already in
canonical format and copied verbatim into the DOM. This conservative approach prevents data in an
unexpected format from being garbled, including data which unexpectedly arrives already in canonical
format. Conservatism is desirable here because canonicalization often involves throwing away characters.
Home Index Bookmark Pages
Pages: Home Index All Pages