Working with Code Lists

EDI dialects are typically associated with one or more code lists, tables that contain a set of codes and their descriptions that can be used to validate EDI segments and messages.

Code list validation is controlled by the tbl XML Converter property in the Select XML Converter Properties dialog box, shown here.

Enabling Code List Validation

By default, Stylus Studio does not perform code list validation against the EDI you are converting to XML (tbl=no). To enable code list validation, set tbl=yes. For an example of code list validation, see Example: Converting a Non-conforming EDI File.

Handling Missing Values

When validation is on, the XML Converters engine raises an error for any missing or unrecognized code list values. You can handle missing or unrecognized values in one of two ways. You can:

l Add missing values to a local copy of the EDI standard code list.
l Add a special value, "..." that suppresses code list validation for that table only.

When you enter "..." for a code list value, any elements with values not in the codelist are treated as valid. Further, if you provide a description for the "..." code list value when you create the code, that value is output in the XML comments. Here, for example, any missing values from the Piece Identification Indicator code list table are output to XML with the comment "missing":

Note that the "..." code value affects code list validation only for the table for which it was created. Code list validation for other tables is unaffected.

See Example: Converting a Non-conforming EDI File for an example of modifying a code list; see Creating a Code to learn how to add a value to a code list.

 
Free Stylus Studio XML Training: