Re: International Address Format Standard - Mailing list pgsql-general

From Manuel Lemos
Subject Re: International Address Format Standard
Date
Msg-id 4332.204T46T9023603mlemos@acm.org
Whole thread Raw
In response to Re: International Address Format Standard  (Gunther Schadow <gunther@aurora.rg.iupui.edu>)
List pgsql-general
Precedence: bulk

Hello Gunther,

On 18-Jun-00 00:41:24, you wrote:


>the Universal Postal Union [http://www.upu.int] keeps some record
>about internationally used address formats. However, what they have is
>also not a standard, but more of an inventory of national peculiarities
>[http://www.upu.int/addressing/AN/AN.pdf]. In HL7, an international
>health care standard, we have been struggling with a standard address
>format for quite a while, and we now came up with an alternative
>solution, which is more like a text-markup approach than a fixed
>data structure. This works well for addresses and person names. You
>can see our draft specification at [http://aurora.rg.iupui.edu/v3dt],
>and specifically you can see an explanation and example of our
>approach at [http://aurora.rg.iupui.edu/v3dt/report.html#PostalAddress]

This interests me but unfortunately some of these links are broken.

Anyway, I am developing a large Web application and at some point I have to
deal with addresses that have to be represented in their original format but
with localized labels.  For instance, if the user of the system preferred
idiom is French and he has to enter addresses for the US, the address shows
with fields and with visual format specific of the US but the labels for
the fields appear in French.

So, I designed a XML format that tells me how addresses are represented
for each country or zone in the world. Then I wrote a parser for this format
that extracts the list of address fields that are needed for the respective
country and the way they should be laid out in listings or forms.

With is information I am able to (hopefully) generate forms for addresses
anywhere in the world. Around this I wrote some code to insert, fetch,
update address records to database using an abstraction layer.

If the format does not take in account enough types of fields or properties
to make it work for a certain country in the world I can always extend to
add the support for the extra tags thanks to the extensibility of XML.

For instance, take this sample of the address representation format in
Portugal.  As you may notice the formats tells about the fields that are
needed for this country, validation regular expression for use in the forms,
field sizes, label position if required, layout controls like extra text
and line breaking and even letter capitalization types.

The format supports more field types than those that are used in this
sample.  It is that they are not needed for this country and so they are
ignored, but with other countries or world zones they may show up.

The code for the parser and database interface will be made freely
available later when I have some time. For now only the form generation
and validation class is available because it is generic and has been
extensively used for many other applications of mine and other users.

If you are interested, you may find the forms class here.  The address and
database interface classes will be classes will be made available in the
same site.  Feel free to subscribe to be notified about any new classes
uploaded there.

http://phpclasses.UpperDesign.com/browse.html/package/1

As for the format, I am interested to discuss its usability and exchange
ideas to extend it and make it more extensible to work in zones of the
world where it may no be suficient now. Just mail me back.

<addressformat>

    <address>
        <validation>^[^ \t\n\r]+</validation>
        <label>left</label>
        <rows>3</rows>
        <columns>30</columns>
    </address>

    <linebreak />

    <location>
        <validation>^[^ \t\n\r]+</validation>
        <label>left</label>
    </location>

    <linebreak />

    <postalcode>
        <validation>^[0-9]{4}$</validation>
        <label>left</label>
        <length>4</length>
    </postalcode>

    <text> </text>

    <postalsubcode>
        <validation>^[0-9]{3}$</validation>
        <length>3</length>
    </postalsubcode>

    <text> </text>

    <postalcodelocation>
        <validation>^[^ \t\n\r]+</validation>
        <capitalization>uppercase</capitalization>
    </postalcodelocation>

</addressformat>

Regards,
Manuel Lemos

Web Programming Components using PHP Classes.
Look at: http://phpclasses.UpperDesign.com/?user=mlemos@acm.org
--
E-mail: mlemos@acm.org
URL: http://www.mlemos.e-na.net/
PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp
--


pgsql-general by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Installing clients (psql) only
Next
From: Lamar Owen
Date:
Subject: Re: Installing clients (psql) only