ISO 10744, which defines extensions to SGML in an annex, has a formal method for defining lexical types based on a formal definition of a lexical model and an attribute called lextype. However, one does not need to use these standardized methods, and there may be good reasons why one should not do so. Using this technique, we can develop an ANSI ASC X12-compliant method for checking the validity of ANSI ASC X12 messages and develop a general purpose program for lexical checking of ANSI ASC X12 messages that can be shared. Other mechanisms based on the use of XSL can also be demonstrated. In the following example modified from that in question 4, segment-a is replaced with a group consisting of a fixed sequence of three objects.
Groups are the way SGML can be used to create related sets of elements.
See question 7. Another possibility is that the name used for the element can be dependent on local usage and not be linked directly to the source of the definition or the context in which the object was originally used. The Unit of Measure, DE355 has 418 code values. XML tags are not positional, however specific data element names may be. For example, in ANSI ASC X12, the N2 segment is only meaningful in the context of the N1 segment that precedes it.