As with our other formats, there are four schemas involved in describing X12 interchanges and their xml representation.
The schemas introduced in this chapter are very similar to those developed in Chapters 7 and 8. The main difference in our X12 schemas is that instead of using the FieldGrammarType from our common schema, we define an ElementGrammarType. The main reason we do this is that our X12 utilities don't support all the other data types we have defined. We create a new X12DataType simple type for the DataType Attribute instead of using the BBDataType.
Note that the SegmentType complex type, unlike the flat file's FlatRecordType and the CSV's RowDescription Element, allows two different types of child Elements in its sequence. We can have a mix of SimpleElementDescription Elements and CompositeStructureDescription Elements. We indicate this with a choice content model within the sequence.