split x12 into multiple xml files

38 views
Skip to first unread message

xiop...@gmail.com

unread,
Jun 7, 2022, 1:42:29 AM6/7/22
to Bots Open Source EDI Translator
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>  

Eppye Bots

unread,
Jun 7, 2022, 8:33:01 AM6/7/22
to 'Chuck Turco' via Bots Open Source EDI Translator
this is the 3rth time you are asking about the same question.
please see answer at previous, very similar questions.

kind regards, Henk-Jan Ebbers


--
You received this message because you are subscribed to the Google Groups "Bots Open Source EDI Translator" group.
To unsubscribe from this group and stop receiving emails from it, send an email to botsmail+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/botsmail/168f08c5-d144-4e1c-ae0d-222759a89d09n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages