WSEDI Level 0
Apr 12th, 2007 by Ricker
Minimal Representation
The primary purpose of WS-EDI is to enable programmers to handle EDI data using common XML parsers. The WS-EDI Level 0 representation provides the minimal necessary XML representation of an EDI message, that is, the minimal necessary to parse the message with an XML parser rather than EDI parser. In essence, Level 0 simply replaces the EDI delimiters with XML tags. Root
The root element of a WS-EDI document is wsedi. The namespace is http://www.wsedi.org/ns/edi/4.1/. An example is as follows:
<wsedi xmlns="http://www.wsedi.org/ns/edi/4.1/"> ...
Segment
In Level 0, the wsedi element contains a sequence of elements named segment. Each segment has a code attribute. A segment can contains a sequence of elements and composites. The document type definition (DTD) is as follows:
<!ELEMENT wsedi (segment+)> <!ELEMENT segment ((element|composite)*)> <!ATTLIST segment code CDATA #REQUIRED>
For simplicity, we will use DTD notation for our schemas. Other schema representations are available at the end of the specification.
An example of a segment is as follows:
<segment code="REF">...
Element
In Level 0 representation, an element contains the value of the element as content and the sequence of the element as an attribute. The schema is:
<!ELEMENT element (#PCDATA)> <!ATTLIST element seq CDATA #REQUIRED>
As an example, the following X12 EDI fragment:
REF*AH*M109~
would be have the WS-EDI Level 0 representation as:
<segment code="REF"> <element seq="REF01">AH <element seq=”REF02″>M109 </segment>
Composites
In Level 0 representation, an composite contains a series of elements as contents and the sequence of the composite as an attribute. The schema is as follows:
<!ELEMENT composite (element+)> <!ATTLIST composite seq CDATA #REQUIRED>
As an example, the following EDIFACT fragment:
EQD+RR+X:::+1:::X+2+1+5'
would be have the WS-EDI Level 0 representation as:
<segment code="EQD"> <element seq="EQD01">RR <composite seq=”EQD02″> <element seq=”EQD0201″>X <element seq=”EQD0202″/> <element seq=”EQD0203″/> <element seq=”EQD0204″/> </composite> <composite seq=”EQD03″> <element seq=”EQD0301″>1 <element seq=”EQD0302″/> <element seq=”EQD0303″/> <element seq=”EQD0304″>X </composite> <element seq=”EQD04″>2 <element seq=”EQD05″>1 <element seq=”EQD06″>5 </segment>
Note that the elements within the composite take an extended sequence from the composite’s sequence. The element with sequence EQD0203 is the third element in composite EQD02.
Interchanges and functional groups
In the Level 0 minimal representation, there is no differentiation of header segments such as ISA, GS in X12 or UNA, UNB in EDIFACT. These header segments are simply treated as segments. As such, the Level 0 minimal representation is a very flat tree.
Example documents
- An EDIFACT document and its Level 0 representation.
- An X12 document and its Level 0 representation.
Leave a Reply
You must be logged in to post a comment.