<?xml version="1.0"?>
<form xmlns="http://www.demandware.com/xml/form/2008-04-19">

    <field formid="addressId" label="label.input.addressid" type="string" mandatory="true"
    	   max-length="20" missing-error="error.message.required" range-error="error.message.20orless"/>
    <field formid="firstName" label="label.input.firstname.profile" type="string" mandatory="true" binding="firstName"
           max-length="50" missing-error="error.message.required" range-error="error.message.50orless"/>
    <field formid="lastName" label="label.input.lastname.profile" type="string" mandatory="true" binding="lastName" max-length="50"
           missing-error="error.message.required" range-error="error.message.50orless"/>
    <field formid="address1" label="label.input.address1" type="string" mandatory="true" binding="address1" max-length="50"
           missing-error="error.message.required" range-error="error.message.50orless"/>
    <field formid="address2" label="label.input.address2" type="string" mandatory="false" binding="address2"
           max-length="50" range-error="error.message.50orless"/>
    <field formid="city" label="label.input.city" type="string" mandatory="true" binding="city" min-length="2"
           max-length="50" missing-error="error.message.required" range-error="error.message.between2and50"/>

    <!--  postal code -->
    <field formid="postalCode" label="label.input.zipcode" type="string" mandatory="true" min-length="5" max-length="10"
           regexp="(^([0-9]){5}$)"
           binding="postalCode"
           range-error="error.message.between5and10"
           missing-error="error.message.required"
           parse-error="error.message.parse.zip"/>

    <!-- use set of supported countries -->
    <field formid="country" label="label.input.country" type="string" mandatory="true" binding="countryCode"
           missing-error="error.message.required">
        <options>
            <option optionid="IT" label="select.option.country.italy" value="IT"/>
        </options>
    </field>

    <!-- use global state list -->
    <include formid="states" name="states"/>

    <!-- phone is mandatory for addresses -->
    <field formid="phone" label="label.input.phonenumber" description="address.phone.example" type="string" mandatory="true"
           binding="phone" min-length="10" max-length="20"
           missing-error="error.message.required"
           range-error="error.message.between10and20"
           parse-error="error.message.parse.phone"
           regexp="(^(([0-9]{2,4})([-\s\/]{0,1})([0-9]{4,8}))?$)"/>

    <!-- actions provided by the edit shipping address dialog -->
    <action formid="apply" valid-form="true"/>
    <action formid="remove" valid-form="false"/>
</form>
