Skip to content

Instantly share code, notes, and snippets.

@deepakstrigent
Created April 3, 2013 11:29
Show Gist options
  • Save deepakstrigent/5300411 to your computer and use it in GitHub Desktop.
Save deepakstrigent/5300411 to your computer and use it in GitHub Desktop.
#12 patch
--- pyx12/x12n_document.py
+++ patch/x12n_document.py
@@ -105,6 +105,8 @@
#erx = errh_xml.err_handler(basedir=basedir)
valid = True
+
+ cur_map = None
for seg in src:
#find node
orig_node = node
@@ -113,6 +115,14 @@
node = control_map.getnodebypath('/ISA_LOOP/ISA')
elif seg.get_seg_id() == 'GS':
node = control_map.getnodebypath('/ISA_LOOP/GS_LOOP/GS')
+ elif seg.get_seg_id() == 'ST' and cur_map is not None:
+ node = cur_map.getnodebypath('/ISA_LOOP/GS_LOOP/ST_LOOP/ST')
+ try:
+ (node, pop_loops, push_loops) = walker.walk(node, seg, errh,
+ src.get_seg_count(), src.get_cur_line(), src.get_ls_id())
+ except pyx12.errors.EngineError:
+ logger.error('Source file line %i' % (src.get_cur_line()))
+ raise
else:
try:
(node, pop_loops, push_loops) = walker.walk(node, seg, errh,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment