Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Add these atribut sets in the XML as follows

Code Block
languagexml
titleGeneral Address Template
	<nameMappings class="properties">
            <property name="postalCode" value="Location.postalCode"/>
            <property name="longitude" value="Location.longitude"/>
	    ... others
   	</nameMappings>    
      

Now define the character size for each of the attribute you selected
Name = attribute name
value = Number of charecters
E.g.

Code Block
languagexml
titleGeneral Address Template
	<sizeMappings class="properties">
            <property name="postalCode" value="10"/>
            <property name="longitude" value="10"/>
	    ... others
	</sizeMappings>

...

E.g.

Code Block
languagexml
titleGeneral Address Template
	<lineByLineFormat>
            <string>address1</string>
            <string>address2</string>
            <string>cityVillage stateProvince country postalCode</string>
            <string>latitude longitude</string>
            <string>startDate endDate</string>
        </lineByLineFormat>

(OPtional) You can add default values for the attribute as bellow
E.g.

Code Block
languagexmltitleGeneral Address Template
        <elementDefaults>
            <property name="country" value="Kenya"/>
            ...
        </elementDefaults>

...

E.g.
Reguler expressions to validation;

Code Block
title
languagexmlGeneral Address Template
        <elementRegex>
            <property name="longitude" value="^(\\d{1,3}\\s)\\d\\d.(\\d{2,3})\\s*$"/>
            <property name="latitude" value="^(\\d{1,3}\\s)\\d\\d.(\\d{2,3})\\s*$"/>
            ...
        </elementRegex>

Input sugessions;

Code Block
languagexmltitleGeneral Address Template
        <elementRegexFormats>
            <property name="longitude" value="123 45.000"/>
            <property name="latitude" value="123 45.000"/>
            ...
        </elementRegexFormats>

Fianly you can bundle all in one xml as

Code Block
languagexml
titleGeneral Address Template

       <addressTemplate>
            <nameMappings class="properties">
                <property name="postalCode" value="Location.postalCode"/>
	        ...
            </nameMappings>
            <sizeMappings class="properties">
                <property name="postalCode" value="10"/>
                ...
            </sizeMappings>
            <lineByLineFormat>
                <string>address1</string>
                <string>address2</string>
                ...
            </lineByLineFormat>
            ...
            ...
        </addressTemplate>

Please reffer the sample for further claricationFor further clarification please go through the samples bellow,

Anchor
General
General

Code Block
controlstrue
languagexml
titleGeneral Address Template
    <addressTemplate>
        <nameMappings class="properties">
            <property name="postalCode" value="Location.postalCode"/>
            <property name="longitude" value="Location.longitude"/>
            <property name="address2" value="Location.address2"/>
            <property name="address1" value="Location.address1"/>
            <property name="startDate" value="PersonAddress.startDate"/>
            <property name="country" value="Location.country"/>
            <property name="endDate" value="personAddress.endDate"/>
            <property name="stateProvince" value="Location.stateProvince"/>
            <property name="latitude" value="Location.latitude"/>
            <property name="cityVillage" value="Location.cityVillage"/>
        </nameMappings>
        <sizeMappings class="properties">
            <property name="postalCode" value="10"/>
            <property name="longitude" value="10"/>
            <property name="address2" value="40"/>
            <property name="address1" value="40"/>
            <property name="startDate" value="10"/>
            <property name="country" value="10"/>
            <property name="endDate" value="10"/>
            <property name="stateProvince" value="10"/>
            <property name="latitude" value="10"/>
            <property name="cityVillage" value="10"/>
        </sizeMappings>
        <lineByLineFormat>
            <string>address1</string>
            <string>address2</string>
            <string>cityVillage stateProvince country postalCode</string>
            <string>latitude longitude</string>
            <string>startDate endDate</string>
        </lineByLineFormat>
    </addressTemplate>

...