XML transform: Lookup
The files that are used for looking up values must already exist in the workspace within the current module or in a library. The map editor provides the following types of lookups:
- Relationship lookup
- takes an input and uses a defined static relationship in order to produce a target value. The transform takes a single input element and a single output element. Both input and output elements must be simple XSD type elements. If no output is defined for the provided input, the value of property "com.ibm.wbit.mapping.xml.lookup.default" defined on the output role is used, or an empty string is used, if no property of that name is defined.
- Properties file
- uses an existing properties file that contains a list of keys and values. The properties file must have a key=value format. The key must not contain the = character. The properties file specification is the same as the java.util.Properties class. The file must have a .properties extension.
- Comma Separated Value File Lookup
- retrieves values from a comma separated value file where the
format is token,token....
If you want to use a comma in one of the token strings, precede the comma with the escape character forward slash
/.Because a lookup takes a source as input and produces a value for the target, you can control the index in the CSV file that is used to match the key and the index from which the value is returned. To specify the index, use the Column index setting. The first index is zero. You can also use a heading name and the index of the given header name will be used as the index. If a heading name is used, it is assumed that the first line of the csv file has the headings for the subsequent rows.
For example, suppose this is your comma separated file:
If you want to input an ID and set the country in the target, set the source column index to 0 and the target value column index to 2. If the input element has the value A001 the value set in the target is Austria.ID, City, Country A001, Vienna, Austria B020, Dhaka, Bangladesh C005, Beijing, China - Custom lookup
- You can create your own custom lookup engine. For more information, see Creating a custom lookup .
This topic only applies to BAW, and is located in the BAW repository. Last updated on 2025-03-13 12:15