-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem parsing - ideas needed #51
Comments
@kputnam I have tried the last two days to recreate the guide and transaction set definition for message When originally implementing this message we were getting a lot of NonDeterministic errors and you suggested collapsing some loops. This worked in the sense |
Can you email me a sample document and tell me which branch you're working in? I have a vague understanding of the problem but not enough to troubleshoot. |
PS: In your example you're looping over |
This example seems unusual to me, so let me know if I've misunderstood. Here's my translation: First, start at Print the gs.find(:ST).flatmap{|x| x.find(:LS,'A') }
.tap do |ls|
ls.iterate(:N1, 'HH') do |n1|
puts "N1 HH #{n1.element(2).map(&:node).fetch(0)}"
n1.find(:N1, 'HH').flatmap{|x| x.find(:RMT,'IV') }
.tap do |rmt|
@seller_invoice_number = "#{rmt.element(2).map(&:node).fetch(0)}"
@total_gross_amount = "#{rmt.element(3).map(&:node).fetch(0)}"
puts "RMT IV [$#{@total_gross_amount}] #{@seller_invoice_number}"
puts "==========================="
end I suspect you have one too many traversals, and |
When I first implemented message RA 820 v3010, I was getting lots of non-deterministic problems and with your guidance we collapse some loops and items and both tools: edi-pp and edi-ed parse the data correctly.
My problem is that if I manually traverse the tree, I get to a loop of
N1
items which belong to a particular segment and the parser parses all theN1
not just the ones that belong to the parent.Here is my code:
The problem is on the last item
N1 LI
which it iterates through all the LI on the file, not the ones just belonging to the parent N1The text was updated successfully, but these errors were encountered: