Giter VIP home page Giter VIP logo

Comments (4)

azoner avatar azoner commented on July 30, 2024

I am not able to reproduce your example. Perhaps we could start with a concrete example. From what I can see, the ST segments do repeat properly. There is only one instance of an ST loop though. Is that your complaint?

https://gist.github.com/azoner/5286718

from pyx12.

deepakstrigent avatar deepakstrigent commented on July 30, 2024

Please have a look at these (both are 4010) -
https://gist.github.com/deepakstrigent/5291427
https://gist.github.com/deepakstrigent/5291438

For 832 the maps are newly written (included in gist). 830 is already present in pyX12
Have a look at second segment in GS_LOOP for both cases
The ST information is parsed as GS and it occurs outside of ST_LOOP

Also tried a sample 820 with the same result.

I get the same error while parsing both -

2013-04-02 16:13:35,852 ERROR No current segment in error_handler. Line:3 SEG:1 - Segment ST*832 not found.  Started at /ISA_LOOP/GS_LOOP/GS[SC]
2013-04-02 16:13:35,869 ERROR No current segment in error_handler. Line:46 SEG:3 - Mandatory segment "Transaction Set Header" (ST) missing
Traceback (most recent call last):
  File "/home/xxxx/envs/xxxx1/bin/x12xml", line 9, in <module>
    load_entry_point('pyx12==2.0.0', 'console_scripts', 'x12xml')()
  File "/home/xxxx/envs/xxxx1/local/lib/python2.7/site-packages/pyx12/scripts/x12xml.py", line 112, in main
    fd_997=None, fd_html=None, fd_xmldoc=fd_xml)
  File "/home/xxxx/envs/xxxx1/local/lib/python2.7/site-packages/pyx12/x12n_document.py", line 185, in x12n_document
    errh.close_st_loop(node, seg, src)
  File "/home/xxxx/envs/xxxx1/local/lib/python2.7/site-packages/pyx12/error_handler.py", line 318, in close_st_loop
    self.cur_st_node.close(node, seg, src)
AttributeError: 'NoneType' object has no attribute 'close'

from pyx12.

deepakstrigent avatar deepakstrigent commented on July 30, 2024

John,
Was able to fix the above issue. Not sure how good the fix is - https://gist.github.com/deepakstrigent/5300411
Had to add the walker to stop it to throw ST not found exception.

Now single instance of ST_LOOP is definitely an issue. Again have a stop gap wrapper written around to solve it. But could it be possible to have ST_LOOP per transaction set?

from pyx12.

azoner avatar azoner commented on July 30, 2024

This is a general issue of loop xml elements not being generated for loop repeats - not limited to ST_LOOP.

from pyx12.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.