Skip to content.
|Networking government in New Zealand.

5 Address (xAL) overview

Unlike name structures, there is only one level of complexity for an address. The root xAL element may contain any number of AddressDetails elements that actually contain the address data (see Figure 7). This structure is designed to represent all possible NZ address formats and the most common forms of international addresses.

Note that the AddressDetails element has containers for specific postal data (element Postal, see Figure 8), geospatial data (element Geospatial) and identifiers (element Identifiers).

5.1 Address formatting attributes (helpful for overseas addresses)

Every country or culture has specific rules for address formatting. Formatting a New Zealand address follows some common sense rules. These can be hard-coded into the applications with some degree of certainty that they won't change in the near future. Formatting international addresses may be difficult without knowing local rules. For example, in some countries an address begins with the country name and ends with the recipient name.

A solution for international address formatting may be to store the specific formatting information along with the address data. This may be done through the use of formatting attributes. The attributes may be applied to many xAL elements that can contain text nodes (textual information). The formatting attributes reside in their own namespace and are illustrated in Figure 9.

The formatting attributes may specify the position of the element in the presentation of the address as line/position. In addition the formatting attributes may wrap a particular piece of data, such as value of an element, for example the thoroughfare name, and provide the original presentation for that locale.

5.1.1 Sample code for formatting an international addresses

An illustration of coding for an international address could be a Swiss address that slightly differs from New Zealand traditional address presentation:

Rahel Schmidt

Jonen str. 25

8913 Ottenbach

Switzerland

This address has a different order of address elements. This order is traditional to Switzerland. The formatting will be preserved through the formatting attributes in the following sample code:


[ Previous | Next ]