grammar and mapping script for X12 204 translation to XML

337 views
Skip to first unread message

Ronak Tali

unread,
Sep 1, 2013, 6:35:49 PM9/1/13
to bots...@googlegroups.com
Hi There,

Can any body help me with by providing grammar and mapping script for X12 204 translation to XML ?

Thanks
Ronak Tali

BikeMike

unread,
Sep 2, 2013, 1:36:33 AM9/2/13
to bots...@googlegroups.com
Hi Ronak,
XML can potentially contain "anything" but there is no EDI standard for it. So you first need to know what the XML should look like.
Then work backwards from that: create a grammar for the XML you require, then create a mapping.

I think you can also create an xml representation of the X12 document using xmlnocheck and inn2out() function in the mapping script. But I don't know what use this type of straight conversion would be?

Kind Regards,
Mike

ss...@zulily.com

unread,
Sep 4, 2013, 2:31:13 PM9/4/13
to bots...@googlegroups.com
Hi BikeMike,

I'm sure what Ronak want is to have a 204 "Motor Carrier Load Tender" message translated from x12 format to xml format and also have human readable, meaningful xml tags. That is exactly what am I looking for right now.
I feel that this kind of mapping script must have been written a lot of times by other people already, but I could not find anything through a google search. Maybe it is because everyone will have their own business logic and map to different things so we think it is useless to others so no one thought about share it.
However, I feel if someone can share a basic mapping script that covers the majority of the fields, it would be very useful. Others can customize it from there or even just simply use it. Just like the plugins list for the more popular messages. http://sourceforge.net/projects/bots/files/plugins/ Frankly, I used a couple directly without any customization.
I'll share it if I got my boss's approval.

--Gordon

BikeMike

unread,
Sep 4, 2013, 6:43:24 PM9/4/13
to bots...@googlegroups.com

On Thursday, September 5, 2013 4:01:13 AM UTC+9:30, ss...@zulily.com wrote:
I'm sure what Ronak want is to have a 204 "Motor Carrier Load Tender" message translated from x12 format to xml format and also have human readable, meaningful xml tags. That is exactly what am I looking for right now.

Hi Gordon,
What I meant was that the xml output is presumably going to be imported into some other system. So you should determine it's requirements and map to that, to avoid having to do another mapping in that system. Using "human readable" xml tags is only useful if you intend a human to read it, and that's not what EDI should be about.

One approach I suggested in the previous post is to just create an inn2out mapping and use output type xmlnocheck. This should give you xml of the entire document structure; the xml tags will be the X12 segment tags. Then use xml2botsgrammar to reverse-engineer that back to an xml grammar, where you could rename the tags as required, and create a mapping script using those names. Maybe easier you could add a description attribute to each xml tag (I haven't tried any of this though...).

Kind Regards,
Mike

henk-jan ebbers

unread,
Sep 4, 2013, 6:45:46 PM9/4/13
to bots...@googlegroups.com

On 09/04/2013 08:31 PM, ss...@zulily.com wrote:
> Hi BikeMike,
>
> I'm sure what Ronak want is to have a 204 "Motor Carrier Load Tender" message translated from x12 format to xml format and also have human readable, meaningful xml tags. That is exactly what am I
> looking for right now.
> I feel that this kind of mapping script must have been written a lot of times by other people already, but I could not find anything through a google search. Maybe it is because everyone will have
> their own business logic and map to different things so we think it is useless to others so no one thought about share it.
in (almost) every edi implementation I am amazed by the differences in business logic.
some companies need this, other that.
even with the same ERP system it will often be very different.....not to talk about the partner requirements.
eg the partnerID's they send are not in your system, you'll eg need a conversion table, calculations have to be performed in the mapping (yak!).
(of course it is preferable to have translations without all the 'trics'.

if I develop a plugin for general use in bots, I sometimes start with something I did before (real life implementation).
but it is a lot of work to make it general.

> However, I feel if someone can share a basic mapping script that covers the majority of the fields, it would be very useful. Others can customize it from there or even just simply use it. Just like
> the plugins list for the more popular messages. http://sourceforge.net/projects/bots/files/plugins/ Frankly, I used a couple directly without any customization.
That is good to hear!
this is for one partner, and a lot is probably very specific.
note eg that they leave of a lot, eg B201, B203, B205.
would be great to have such a thing!
a good thing to do is to have another MIG of 204 next to it (o another customer), and check it with that.

kind regards,
henk-jan

> I'll share it if I got my boss's approval.
>
> --Gordon
>
>
> On Sunday, September 1, 2013 10:36:33 PM UTC-7, BikeMike wrote:
>
> Hi Ronak,
> XML can potentially contain "anything" but there is no EDI standard for it. So you first need to know what the XML should look like.
> Then work backwards from that: create a grammar for the XML you require, then create a mapping.
>
> I think you can also create an xml representation of the X12 document using xmlnocheck and inn2out() function in the mapping script. But I don't know what use this type of straight conversion
> would be?
>
> Kind Regards,
> Mike
>
> --
> 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.
> For more options, visit https://groups.google.com/groups/opt_out.

Gordon Sun

unread,
Sep 4, 2013, 9:13:35 PM9/4/13
to bots...@googlegroups.com
Thank you very much for the suggestion! It works for us (to some level).
However I got a problem that I have to specify a translation for each message type 204004010 997004010 , etc.
I cannot simply say editype x12 message type x12 . It will error out say:
TranslationNotFoundError: Translation not found for editype "x12", messagetype "997004010"...
Do you have any solution for this?

--Gordon


--
Reply all
Reply to author
Forward
0 new messages