I have an edi 943 file that is being sent and contains multiple divisions at the line level. I have to convert from x12 EDI to a xml export but I want 1 xml file per division. The xml format is Header and Details. The EDI file contains 3 distinct divisions and I am able to successfully create 3 headers for the distinct divisions. However I cannot get it to give me 3 xml files. It just creates 1 xml file with 3 HEADER tags. I tried to set merge to false and make the message block be the division but nothing seems to work. Am I missing something?
======GRAMMAR===========================
from bots.botsconfig import *
syntax = {
'indented':True,
'merge':False,
}
nextmessageblock = ({'BOTSID':'HEADER','DIVISION':None})
structure = [
{ID:'HEADER',MIN:1,MAX:1,
QUERIES:{
'frompartner': {'BOTSID':'HEADER','SENDER':None},
'topartner': {'BOTSID':'HEADER','RECEIVER':None},
'testindicator':{'BOTSID':'HEADER','TESTINDICATOR':None},
},
LEVEL:[
{ID:'COMMENTS',MIN:0,MAX:1,LEVEL:[
{ID:'COMMENT',MIN:1,MAX:99999},
]},
{ID:'DETAILS',MIN:0,MAX:1,LEVEL:[
{ID:'DETAIL',MIN:1,MAX:99999},
]},
]},
]
================================================================
export
<?xml version="1.0" encoding="utf-8" ?>
<HEADER>
<
DIVISION >GUESS</CUSTID>
</HEADER>
<?xml version="1.0" encoding="utf-8" ?>
<HEADER>
<
DIVISION>JRS</DIVISION >
</HEADER>
<?xml version="1.0" encoding="utf-8" ?>
<HEADER>
<
DIVISION >LM</
DIVISION >
</HEADER>