Support Files : Mapping : Mapping File Structure : Attribute Mapping
 

Attribute Mapping

Attribute mapping instructions are contained between the <AttributeMappings> tags. More than one instruction can be included.

The first match in the file is always used. Therefore, entries must be ordered from the most specific to the least specific.

The basic structure of the Attribute Mapping section is displayed below.

<AttributeMappings>

   <MapAttribute Name="UniqueNameOfAttributeMapping">

      <Entry>

         <Filter>

            <FilterName Parameters="ParameterValue"/>

         </Filter>

         <AttributeAssignmentAction Parameters=
"ParameterValue"/
>

      </Entry>

   </MapAttribute>

</AttributeMappings>

Note that <FilterName Parameters="ParameterValue"/> and <AttributeAssignmentAction Parameters="ParameterValue"/> signify filter operators. For more information, see Filters.

The following table describes the tags in the <AttributeMappings> section.

Tag

Description

Status

<MapAttribute>

The <MapAttribute> tag contains all information needed to map from one attribute to another.

Attribute:

Name= The attribute mapping must be assigned a unique name.

Mandatory

<Entry>

The <Entry> tag describes the mapping. There can be more than one <Entry> tag. The <Filter> tag is a child elements of this tag. An <Entry> tag can contain more than one <Filter> tag.

During the mapping process, the first entry with a criteria that matches the list of attributes is chosen.

Mandatory

<Filter>

The <Filter> tag contains the filter for evaluating attributes. A filter can be simple or complex using conditional and logical operators.

Optional

Attribute Mapping Example

In the following example, the S-57 OBJNAM (object name) attribute is mapped to the VPF NAM attribute.

<MapAttribute Name="OBJNAMtoNAM">

   <Entry>

      <Filter>

         <AttributeValueIsUndefined Acronym="OBJNAM"/>

      </Filter>

      <SetAttributeValue Acronym="NAM" Value="UNK" />

   </Entry>

 

   <Entry>

      <Filter>

         <AttributeValueIsUnknown Acronym="OBJNAM" />

      </Filter>

      <SetAttributeValue Acronym="NAM" Value="UNK" />

   </Entry>

 

   <Entry>

      <CopyAttributeValue FromAcronym="OBJNAM" ToAcronym="NAM" />

   </Entry>

</MapAttribute>

In the above mapping (OBJNAMtoNAM):

The first entry sets NAM="UNK" if OBJNAM is undefined.

The second entry sets NAM="UNK" if OBJNAM is unknown.

The third entry copies OBJNAM’s value to NAM.

Two entries use filters. If the test passes, then matching action is taken. There is no filter in the third entry, so attributes automatically match. This structure uses the concept of working from the more specific matches to the less specific matches.