Verifying the Syntax of an EDI Message

Before a document can be translated, the syntax of the document must be verified. Syntax validation is the first in a step in the overall process of converting a document from EDI to XML or vice versa.

After the syntax of the document has been validated, the translation process beings.

Document verification

In order for ensure documents are processed correctly, The Base EDI adapter checks that the syntax of each document matches the description for their document syntax within the document definitions repository of the BizTalk Server 2004 Base EDI adapter.

The Base EDI adapter checks each document based on the following criteria.

Illegal characters

Each document is verified to ensure that all the characters present in the document are allowed according to the character set defined for the document format.

For EDIFACT documents of syntax version UNOA, characters A-Z, 0-9, blank and. , ( ) / - = are allowed.

For syntax version UNOB characters a-z, A-Z, 0-9, blank and . , ( ) / - = : + ` ? are allowed.

All other EDIFACT syntaxes are linked to the standard ISO character sets.

For ANSI X-12 documents characters A-Z, 0-9, blank and !"&'()*+,-./:;?= are allowed and, if desired, a-z, %~@[]_{}\|<>#$.

Furthermore, the following nonprintable characters are allowed within X-12 (hexadecimal notation): 07, 09, 0A, 0B, 0C, 0D, 1C through 1F, and if desired, 01 through 06 and 11 through 17. The other (proprietary) formats can also be linked to character sets.

Separator usage

The locations and the correct usage of the separators defined for the document format are checked.

Numeric elements

Only one character for the decimal notation is allowed in a numeric element, and the decimal notation must be coherent with the document definition. A sign (-) is only allowed for signed elements. The position of the sign must be coherent with the document type or format version definition (begin or end).

Elements of target document

The Base EDI adapter verifies that all mandatory singular elements are present, if all mandatory composite elements are present, and if all mandatory components are present when a conditional composite element is present.

Elements of source document

The Base EDI adapter verifies that all mandatory singular elements are present, if all mandatory composite elements are present, and if all mandatory components are present when a conditional composite element is present.

Segments

Documents are checked to verify that all mandatory segments are present. The Base EDI adapter verifies that the number of occurrences for each segment is correct. Occurrence 0 (zero) means infinite.

Qualifiers and code sets

Segments are checked to verify if all mandatory qualifiers and codes are present and if the qualifiers and codes read are allowed according to the specified set for each element.

Number of documents and of segments

For EDIFACT and X-12 interchanges, the interchange control count in the UNZ/ IEA segment must be equal to the number of documents in the interchange. For documents within an interchange, the number of segments in the UNT/ SE segment must be equal to the number of segments in the document. The same rules apply to the functional group headers and trailers.

References

For EDIFACT and ANSI X-12 interchanges, the interchange control reference in the UNB/ ISA segment must be equal to the interchange control reference in the UNZ/ IEA segment. For documents within an interchange, the document reference number in the UNH/ ST segment must be equal to the document reference number in the UNT/ SE segment trailer. The same rules apply to the functional group headers and trailers.

Headers and trailers for EDIFACT

The UNA segment does not have to be present. The first segment or the first segment after the UNA segment must be the UNB segment. Each document has to start with the UNH segment and has to end with the UNT segment. The interchange has to end with the UNZ segment. Functional groups are allowed (starting with UNG and ending with UNE).

Headers and trailers for ANSI X-12

The first segment of an interchange must be the ISA segment. Each group of documents should be enclosed between the GS and GE segments. Each document should start with the ST segment and end with the SE segment. The interchanges should end with the IEA segment.

Check all conditions defined for a type of document.

After the syntax of the document has been validated, the translation process begins.

See Also

Base EDI Adapter

To download updated BizTalk Server 2004 Help from www.microsoft.com, go to http://go.microsoft.com/fwlink/?linkid=20616.

Copyright © 2004 Microsoft Corporation.
All rights reserved.
Show: