POST processing information

117 views
Skip to first unread message

Harold DeWayne

unread,
May 14, 2013, 3:22:34 PM5/14/13
to bots...@googlegroups.com
Is it possible to modify a file after merged phase and before the outfile stage?   I've FINALLY got a translation working (an X12 204 to XML) and I successfully got multiple layers of loops at the Stop Level (Stop/Reference, Stop/Note, Stop/Date, Stop/Location, Stop/Goods) so I feel really good about this, but I need to modify the output file to get rid of the "ns0:" Namespace information (with SED maybe) and I need to update the XML information at my LoadTender level in the XML file.

I'm trying to accomplish this with a route script and the postmerge function (using regular expressions [yes I imported re, os and system], or with line.replace() either one ) , but I cannot seem to get the file to change.  I'm sure this is not an uncommon request to make a change to the file after translation.




Thanks in advance (ANYONE).


Harold DeWayne

Harold DeWayne

unread,
May 14, 2013, 4:22:16 PM5/14/13
to bots...@googlegroups.com
BTW:  The reason I want to insert it at this point, I want the outfile processing to show in the log.

Harold.

BikeMike

unread,
May 14, 2013, 6:48:56 PM5/14/13
to bots...@googlegroups.com
Hi Harold,
This definitely should be possible with postprocessing. I have just updated the wiki to add an example as it only showed preprocessing. Maybe you are missing the copyta step?

http://code.google.com/p/bots/wiki/RouteScriptsExample

Kind Regards,
Mike

Harold DeWayne

unread,
May 14, 2013, 6:52:58 PM5/14/13
to bots...@googlegroups.com

Thanks

> --
> You received this message because you are subscribed to a topic in the Google Groups "Bots Open Source EDI Translator" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/botsmail/dmAHnWJloYw/unsubscribe?hl=en.
> To unsubscribe from this group and all its topics, send an email to botsmail+u...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

BikeMike

unread,
May 14, 2013, 7:45:54 PM5/14/13
to bots...@googlegroups.com


henk-jan ebbers

unread,
May 15, 2013, 4:07:52 AM5/15/13
to bots...@googlegroups.com

On 05/14/2013 09:22 PM, Harold DeWayne wrote:
> Is it possible to modify a file after merged phase and before the outfile stage? I've FINALLY got a translation working (an X12 204 to XML) and I successfully got multiple layers of loops at the
> Stop Level (Stop/Reference, Stop/Note, Stop/Date, Stop/Location, Stop/Goods) so I feel really good about this, but I need to modify the output file to get rid of the "ns0:" Namespace information
> (with SED maybe) and I need to update the XML information at my LoadTender level in the XML file.
If you want to specify the namespace to a certain value, this can be done in the grammar.

kind regards,
henk-jan
>
> I'm trying to accomplish this with a route script and the postmerge function (using regular expressions [yes I imported re, os and system], or with line.replace() either one ) , but I cannot seem to
> get the file to change. I'm sure this is not an uncommon request to make a change to the file after translation.
>
>
>
>
> Thanks in advance (ANYONE).
>
>
> Harold DeWayne
> --
> 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.

henk-jan ebbers

unread,
May 15, 2013, 4:09:24 AM5/15/13
to bots...@googlegroups.com

On 05/14/2013 10:22 PM, Harold DeWayne wrote:
> BTW: The reason I want to insert it at this point, I want the outfile processing to show in the log.
Is it not showing now?
You think it should?

kind regards,
henk-jan

Harold DeWayne

unread,
May 15, 2013, 5:12:06 AM5/15/13
to bots...@googlegroups.com
Sorry... I meant the extra processing step between Merged and Outfile...


To unsubscribe from this group and stop receiving emails from it, send an email to botsmail+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.



--
You received this message because you are subscribed to a topic in the Google Groups "Bots Open Source EDI Translator" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/botsmail/dmAHnWJloYw/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to botsmail+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.





--
Harold DeWayne, CECP, RECS
Senior Engineer
Atadex

henk-jan ebbers

unread,
May 15, 2013, 5:50:58 AM5/15/13
to bots...@googlegroups.com
hi Harold,

what is not clear to me:
- you just want to use a specific xml namespace (and postprocessing would be a way to achive this)
- you want to use postprocessing

kind regards,
henk-jan


On 05/15/2013 11:12 AM, Harold DeWayne wrote:
> Sorry... I meant the extra processing step between Merged and Outfile...
>
>
> On Wed, May 15, 2013 at 4:09 AM, henk-jan ebbers <eppye...@gmail.com <mailto:eppye...@gmail.com>> wrote:
>
>
> On 05/14/2013 10:22 PM, Harold DeWayne wrote:
>
> BTW: The reason I want to insert it at this point, I want the outfile processing to show in the log.
>
> Is it not showing now?
> You think it should?
>
> kind regards,
> henk-jan
>
>
>
> Harold.
>
> On Tuesday, May 14, 2013 3:22:34 PM UTC-4, Harold DeWayne wrote:
>
> Is it possible to modify a file after merged phase and before the outfile stage? I've FINALLY got a translation working (an X12 204 to XML) and I successfully got multiple layers of
> loops at
> the Stop Level (Stop/Reference, Stop/Note, Stop/Date, Stop/Location, Stop/Goods) so I feel really good about this, but I need to modify the output file to get rid of the "ns0:" Namespace
> information (with SED maybe) and I need to update the XML information at my LoadTender level in the XML file.
>
> I'm trying to accomplish this with a route script and the postmerge function (using regular expressions [yes I imported re, os and system], or with line.replace() either one ) , but I cannot
> seem to get the file to change. I'm sure this is not an uncommon request to make a change to the file after translation.
>
>
>
>
> Thanks in advance (ANYONE).
>
>
> Harold DeWayne
>
> --
> 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 <mailto:botsmail%2Bunsu...@googlegroups.com>.
>
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
> --
> You received this message because you are subscribed to a topic in the Google Groups "Bots Open Source EDI Translator" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/botsmail/dmAHnWJloYw/unsubscribe?hl=en.
> To unsubscribe from this group and all its topics, send an email to botsmail+u...@googlegroups.com <mailto:botsmail%2Bunsu...@googlegroups.com>.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
>
>
> --
> *Harold DeWayne, CECP, RECS
> *
> *Senior Engineer
> *
> *Atadex*
> --
> 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.
Message has been deleted

henk-jan ebbers

unread,
May 15, 2013, 8:45:46 AM5/15/13
to bots...@googlegroups.com

On 05/15/2013 12:13 PM, Harold DeWayne wrote:
> Henk-Jan
>
> 1) I am uncertain how my customer is processing the data (first problem, I know)
> 2) The customer's _*current*_ data does not specify namespace information at each element... only at the top level
than just use it at the top data?
> 3) The customer's _*current *_data has three pieces of namespace information at the header level: _xmlns_, _xmlns:xsi _and _xsi:schemaLocation_... I need to duplicate this, thus the post-processing
> step.
if I remember correctly I jsut added this in the grammar as attributes, and filled these in the mapping.

(I am a bit too busy to look at this in more detail, sorry)

kind regards,
henk-jan

>
> Whatever I'm doing wrong, Mike's example is not working for me (even if I use his exact sample... sorry Mike).
>
> I've attached a current plugin with all my data so you can see what's happening.
>
> Thanks.
> Harold.
> > To unsubscribe from this group and stop receiving emails from it, send an email to botsmail+u...@googlegroups.com <javascript:> <mailto:botsmail%2Bunsu...@googlegroups.com
> <javascript:>>.
> >
> > For more options, visit https://groups.google.com/groups/opt_out <https://groups.google.com/groups/opt_out>.
> >
> >
> >
> > --
> > You received this message because you are subscribed to a topic in the Google Groups "Bots Open Source EDI Translator" group.
> > To unsubscribe from this topic, visit https://groups.google.com/d/topic/botsmail/dmAHnWJloYw/unsubscribe?hl=en <https://groups.google.com/d/topic/botsmail/dmAHnWJloYw/unsubscribe?hl=en>.
> > To unsubscribe from this group and all its topics, send an email to botsmail+u...@googlegroups.com <javascript:> <mailto:botsmail%2Bunsu...@googlegroups.com <javascript:>>.
> > For more options, visit https://groups.google.com/groups/opt_out <https://groups.google.com/groups/opt_out>.
> >
> >
> >
> >
> >
> > --
> > *Harold DeWayne, CECP, RECS
> > *
> > *Senior Engineer
> > *
> > *Atadex*
> > --
> > 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 <javascript:>.
> > For more options, visit https://groups.google.com/groups/opt_out <https://groups.google.com/groups/opt_out>.

Harold DeWayne

unread,
May 15, 2013, 9:55:53 AM5/15/13
to bots...@googlegroups.com
Thanks... I modified the grammar to take out all the (unnecessary) parts of the names, then I added in the attributes for xmlns, xmlns:xsi and xsi:schemaLocation and everything works flawlessly!!  And WITHOUT post-processing the file!  I expected an issue with the colon (:) in the attribute name but I didn't think about the fact that they're quoted names... what a surprise.

Hopefully this thread can be of assistance to someone else down the road.


Thanks again,

Harold DeWayne

ss...@zulily.com

unread,
Sep 4, 2013, 2:36:18 PM9/4/13
to bots...@googlegroups.com
There are no plugins handles x12 204 message out there http://sourceforge.net/projects/bots/files/plugins/
Is it possible for you to share the mapping script you wrote as a plugin?

Thanks a lot!

--Gordon
Reply all
Reply to author
Forward
0 new messages